Round values because DHT sensor precision is definitely not 4+ decimal places (maybe within 5 degrees honestly)

This commit is contained in:
Will Bradley 2020-08-08 17:14:20 +00:00
parent c4352ad6f5
commit eab8ff38e3

View File

@ -28,8 +28,8 @@ while True:
print("TempC={0:0.1f}*C TempF={1:0.1f}*F Humidity={2:0.1f}%".format(temperature_c, temperature_f, humidity))
print('sending data to adafruit io...')
t_out = aio.send(temperature_feed.key, temperature_f)
h_out = aio.send(humidity_feed.key, humidity)
t_out = aio.send(temperature_feed.key, round(temperature_f,1))
h_out = aio.send(humidity_feed.key, round(humidity,1))
if t_out and h_out:
print('data sent, sleeping for '+str(LOOP_DELAY_MINS)+' mins')
else: