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