import Adafruit_DHT class dht22: def __init__(self): self.dht_sensor = Adafruit_DHT.DHT22 self.dht_pin = 4 def get_humidity_temperature(self): return Adafruit_DHT.read_retry(self.dht_sensor, self.dht_pin)