From d8677af657f4eb1000523d94169536c553542aa0 Mon Sep 17 00:00:00 2001 From: Alain FERRARO Date: Mon, 14 Dec 2020 00:11:56 +0100 Subject: [PATCH 1/2] Error if GMT Offset = 0 If GMT Offset = 0 : 'onMessage' failed 'ValueError':'invalid literal for int() with base 10: '''. on line 209 --- plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index a709930..bd29668 100644 --- a/plugin.py +++ b/plugin.py @@ -198,8 +198,12 @@ def onMessage(self, Connection, Data): if(unit['id'] == response['DeviceID']): date,time = response['NextCommunication'].split("T") hours,minutes,sec = time.split(":") - sign = Parameters["Mode1"][0] - value = Parameters["Mode1"][1:] + if Parameters["Mode1"] == '0': + sign = '+' + value = '0' + else: + sign = Parameters["Mode1"][0] + value = Parameters["Mode1"][1:] Domoticz.Debug("TIME OFFSSET :" + sign + value) if(sign == "-"): hours = int(hours) - int(value) From 0c7acb3f807e7ca1695166a27a4d9211a3ea38ef Mon Sep 17 00:00:00 2001 From: Alain FERRARO Date: Sun, 27 Dec 2020 00:26:57 +0100 Subject: [PATCH 2/2] Delay new connection attempt until next heartbeat To avoid cascade error : 2020-10-02 13:56:42.645 (Mitsubishi Airco) MELCloud connection OK 2020-10-02 13:56:42.697 (Mitsubishi Airco) MELCloud receive unknonw message with error code 404 2020-10-02 13:56:42.697 (Mitsubishi Airco) MELCloud has disconnected 2020-10-02 13:56:42.932 (Mitsubishi Airco) MELCloud connection OK 2020-10-02 13:56:42.984 (Mitsubishi Airco) MELCloud receive unknonw message with error code 404 2020-10-02 13:56:42.985 (Mitsubishi Airco) MELCloud has disconnected 2020-10-02 13:56:43.161 (Mitsubishi Airco) MELCloud connection OK 2020-10-02 13:56:43.213 (Mitsubishi Airco) MELCloud receive unknonw message with error code 404 2020-10-02 13:56:43.213 (Mitsubishi Airco) MELCloud has disconnected --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index a709930..3f8c340 100644 --- a/plugin.py +++ b/plugin.py @@ -303,7 +303,7 @@ def onNotification(self, Name, Subject, Text, Status, Priority, Sound, ImageFile def onDisconnect(self,Connection): self.melcloud_state = "Not Ready" Domoticz.Log("MELCloud has disconnected") - self.melcloud_conn.Connect() + self.runAgain = 1 def onHeartbeat(self): if (self.melcloud_conn != None and (self.melcloud_conn.Connecting() or self.melcloud_conn.Connected())):