Changing Temp test
This commit is contained in:
@@ -8,6 +8,7 @@ from paho.mqtt import client as mqtt_client
|
|||||||
|
|
||||||
sensor = adafruit_dht.DHT11(board.D20)
|
sensor = adafruit_dht.DHT11(board.D20)
|
||||||
|
|
||||||
|
def getValues(sensor):
|
||||||
try:
|
try:
|
||||||
temp = sensor.temperature
|
temp = sensor.temperature
|
||||||
humidity = sensor.humidity
|
humidity = sensor.humidity
|
||||||
@@ -21,3 +22,4 @@ except RuntimeError as error:
|
|||||||
except Exception as error:
|
except Exception as error:
|
||||||
sensor.exit()
|
sensor.exit()
|
||||||
raise error
|
raise error
|
||||||
|
return temp, humidity
|
||||||
Reference in New Issue
Block a user