fix
This commit is contained in:
parent
36dfe0b9c9
commit
c436d68a20
@ -48,7 +48,7 @@ while True:
|
||||
# Get Temperature from DHT
|
||||
_, temperature = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
|
||||
|
||||
print("temperature before cut: " + temperature)
|
||||
print("temperature before cut: " + str(temperature))
|
||||
# cut temperature to xx.xx if more then tow digits after "."
|
||||
t_split = temperature.split(".")
|
||||
if len(t_split[1]) > 2:
|
||||
@ -56,7 +56,7 @@ while True:
|
||||
t_split[1] = t_split[1][:-t_cut]
|
||||
temperature = t_split[0] + "." + t_split[1]
|
||||
|
||||
print("temperature after cut: " + str(temperature))
|
||||
print("temperature after cut: " + temperature)
|
||||
# Get Humidity from DHT
|
||||
humidity, _ = Adafruit_DHT.read_retry(DHT_SENSOR, DHT_PIN)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user