fix print issue

This commit is contained in:
robert 2021-02-18 10:15:18 +01:00
parent 3a2d1ec06f
commit 3c37b56fb5

View File

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