Automatically re-enable the device after 15 minutes in case of connection issue with the server
This commit is contained in:
@@ -145,8 +145,9 @@ class BasePlugin:
|
|||||||
if self.pooling_current_step >= self.pooling_steps:
|
if self.pooling_current_step >= self.pooling_steps:
|
||||||
Domoticz.Debug("Retry counter:{}".format(self.retry))
|
Domoticz.Debug("Retry counter:{}".format(self.retry))
|
||||||
if self.retry < 0:
|
if self.retry < 0:
|
||||||
Domoticz.Log("No connection to Heatzy API ==> Device disabled")
|
Domoticz.Status("No connection to Heatzy API ==> Device disabled for 15 minutes")
|
||||||
self.pooling_current_step = 1
|
self.pooling_current_step = - 15 * 60 // self.pooling + self.pooling_steps
|
||||||
|
self.retry = self.max_retry
|
||||||
return
|
return
|
||||||
|
|
||||||
self.mode = self.getMode()
|
self.mode = self.getMode()
|
||||||
@@ -373,6 +374,9 @@ class BasePlugin:
|
|||||||
self.did = ""
|
self.did = ""
|
||||||
return self.mode
|
return self.mode
|
||||||
|
|
||||||
|
#Device is correctly running ==> we reset the retry counter
|
||||||
|
self.retry = self.max_retry
|
||||||
|
|
||||||
return self.mode
|
return self.mode
|
||||||
|
|
||||||
def onOff(self, command):
|
def onOff(self, command):
|
||||||
|
|||||||
Reference in New Issue
Block a user