Use mqtt.loop_start() to reconnect after network disconnect

This commit is contained in:
Dale 2023-04-30 14:11:24 +02:00
parent c5c186accb
commit a586de99c6

View file

@ -114,6 +114,7 @@ class Prediction(threading.Thread):
config["mqtt"]["username"], config["mqtt"]["password"]
)
self.mqtt.connect(config["mqtt"]["broker"], config["mqtt"]["port"], 60)
self.mqtt.loop_start()
print("MQTT: Connected to broker", flush=True)
self.oww = Model(