legacy/EDGE_CODE/dht_22.py

9 lines
230 B
Python
Raw Normal View History

2020-07-13 19:42:32 +02:00
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)