add reconnect time set in function

This commit is contained in:
interfisch 2023-08-19 11:39:06 +02:00
parent 87a76f2e6f
commit bd5a321140
1 changed files with 1 additions and 1 deletions

View File

@ -93,6 +93,7 @@ class Controller:
self.mqtt.on_disconnect = self.on_disconnect
self.mqtt.connect(self.mqtthost, self.mqttport)
self.topic = self.basetopic
self.last_reconnectTry=time.time()
@ -266,7 +267,6 @@ class Controller:
if not self.connected:
if (time.time()>self.last_reconnectTry+30):
self.connectToMQTT()
self.last_reconnectTry=time.time()
self.mqtt.loop(0.1) #with block timeout