Fixed timer position
This commit is contained in:
@@ -79,7 +79,7 @@ def publish(client, temp, humidity):
|
|||||||
else:
|
else:
|
||||||
print(f"Failed to send message to topic {humidTopic}")
|
print(f"Failed to send message to topic {humidTopic}")
|
||||||
|
|
||||||
time.sleep(60.0)
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
@@ -87,6 +87,6 @@ while True:
|
|||||||
client.loop_start()
|
client.loop_start()
|
||||||
temp, humidity = getValues(sensor)
|
temp, humidity = getValues(sensor)
|
||||||
publish(client, temp, humidity)
|
publish(client, temp, humidity)
|
||||||
time.sleep (5.0)
|
time.sleep (60.0)
|
||||||
client.loop_stop() #Stop loop
|
client.loop_stop() #Stop loop
|
||||||
client.disconnect() # disconnect
|
client.disconnect() # disconnect
|
||||||
|
|||||||
Reference in New Issue
Block a user