This commit is contained in:
robert 2021-02-18 10:18:32 +01:00
parent 3c37b56fb5
commit 4398da4a63

View File

@ -48,13 +48,13 @@ _, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
temperature = round(float(temperature),2)
print("temperature after round: " + str(temperature)
print("temperature after round: " + str(temperature))
# Get Humidity from DHT
humidity, _ = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
humidity = round(float(humidity),2)
print("humidity after round: " + str(humidity)
print("humidity after round: " + str(humidity))
# Publish our data
client.publish(temperature_topic, temperature)
client.publish(humidity_topic, humidity)