Wifi and MQTT checks and reconnects added, forgot some variables
This commit is contained in:
@@ -586,9 +586,9 @@ def main():
|
|||||||
info("Zero complete")
|
info("Zero complete")
|
||||||
|
|
||||||
# umqtt.robust handles reconnection automatically — just connect once
|
# umqtt.robust handles reconnection automatically — just connect once
|
||||||
client = connect_mqtt()
|
connect_mqtt()
|
||||||
publish_discovery(client)
|
publish_discovery(client_ref)
|
||||||
publish_state(client)
|
publish_state(client_ref)
|
||||||
|
|
||||||
info("Entering main loop")
|
info("Entering main loop")
|
||||||
info("-" * 48)
|
info("-" * 48)
|
||||||
@@ -619,7 +619,7 @@ def main():
|
|||||||
utime.sleep_ms(1000)
|
utime.sleep_ms(1000)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
client.check_msg()
|
client_ref.check_msg()
|
||||||
|
|
||||||
now = utime.ticks_ms()
|
now = utime.ticks_ms()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user