From bacdea05ae53926d699db361b3960bf443a36780 Mon Sep 17 00:00:00 2001 From: davesmeghead Date: Wed, 7 Aug 2024 18:50:49 +0100 Subject: [PATCH] 0.9.6.20 - bug fix for panel loss of response --- custom_components/visonic/client.py | 2 +- custom_components/visonic/manifest.json | 2 +- custom_components/visonic/pyvisonic.py | 28 ++++++++++++------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/custom_components/visonic/client.py b/custom_components/visonic/client.py index 98dd725..6145a2c 100644 --- a/custom_components/visonic/client.py +++ b/custom_components/visonic/client.py @@ -122,7 +122,7 @@ # "trigger", #] -CLIENT_VERSION = "0.9.6.17" +CLIENT_VERSION = "0.9.6.20" MAX_CLIENT_LOG_ENTRIES = 300 diff --git a/custom_components/visonic/manifest.json b/custom_components/visonic/manifest.json index 317256b..e9dd819 100644 --- a/custom_components/visonic/manifest.json +++ b/custom_components/visonic/manifest.json @@ -11,5 +11,5 @@ "loggers": ["visonic"], "requirements": ["Pillow", "pyserial_asyncio"], "single_config_entry": false, - "version": "0.9.6.17" + "version": "0.9.6.20" } diff --git a/custom_components/visonic/pyvisonic.py b/custom_components/visonic/pyvisonic.py index 4f5fea4..87edbc1 100644 --- a/custom_components/visonic/pyvisonic.py +++ b/custom_components/visonic/pyvisonic.py @@ -100,7 +100,7 @@ def convertByteArray(s) -> bytearray: from pyhelper import (toString, MyChecksumCalc, AlImageManager, ImageRecord, titlecase, pmPanelTroubleType_t, pmPanelAlarmType_t, AlPanelInterfaceHelper, AlSensorDeviceHelper, AlSwitchDeviceHelper) -PLUGIN_VERSION = "1.3.6.3" +PLUGIN_VERSION = "1.3.6.5" # Some constants to help readability of the code @@ -206,20 +206,20 @@ def convertByteArray(s) -> bytearray: # This data defines each panel type's maximum capability pmPanelConfig_t = { # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 See pmPanelType_t above "CFG_SUPPORTED" : ( False, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True, True ), # Supported Panels i.e. not a PowerMax - "CFG_KEEPALIVE" : ( 10000, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 15, 25, 25, 15 ), # Keep Alive message interval if no other messages sent - "CFG_DLCODE_1" : ( "5650", "5650", "5650", "5650", "5650", "5650", "5650", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA" ), # Default download codes (for reset panels or panels that have not been changed) - "CFG_DLCODE_2" : ( "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB" ), # Alternative (Master) known default download codes - "CFG_PARTITIONS" : ( 1, 1, 1, 1, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ), - "CFG_EVENTS" : ( 250, 250, 250, 250, 250, 250, 250, 250, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000 ), - "CFG_KEYFOBS" : ( 8, 8, 8, 8, 8, 8, 8, 8, 32, 32, 32, 32, 32, 32, 32, 32, 32 ), - "CFG_1WKEYPADS" : ( 8, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), - "CFG_2WKEYPADS" : ( 2, 2, 2, 2, 2, 2, 2, 8, 32, 32, 32, 32, 32, 32, 32, 32, 32 ), - "CFG_SIRENS" : ( 2, 2, 2, 2, 2, 2, 2, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8 ), - "CFG_USERCODES" : ( 8, 8, 8, 8, 8, 8, 8, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 ), + "CFG_KEEPALIVE" : ( 0, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 15, 25, 25, 15 ), # Keep Alive message interval if no other messages sent + "CFG_DLCODE_1" : ( "", "5650", "5650", "5650", "5650", "5650", "5650", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA" ), # Default download codes (for reset panels or panels that have not been changed) + "CFG_DLCODE_2" : ( "", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "AAAA", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB", "BBBB" ), # Alternative (Master) known default download codes + "CFG_PARTITIONS" : ( 0, 1, 1, 1, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 ), + "CFG_EVENTS" : ( 0, 250, 250, 250, 250, 250, 250, 250, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000 ), + "CFG_KEYFOBS" : ( 0, 8, 8, 8, 8, 8, 8, 8, 32, 32, 32, 32, 32, 32, 32, 32, 32 ), + "CFG_1WKEYPADS" : ( 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), + "CFG_2WKEYPADS" : ( 0, 2, 2, 2, 2, 2, 2, 8, 32, 32, 32, 32, 32, 32, 32, 32, 32 ), + "CFG_SIRENS" : ( 0, 2, 2, 2, 2, 2, 2, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8 ), + "CFG_USERCODES" : ( 0, 8, 8, 8, 8, 8, 8, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48 ), "CFG_PROXTAGS" : ( 0, 0, 8, 0, 8, 8, 0, 8, 32, 32, 32, 32, 32, 32, 32, 32, 32 ), "CFG_ZONECUSTOM" : ( 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ), - "CFG_WIRELESS" : ( 28, 28, 28, 28, 28, 28, 29, 29, 62, 62, 62, 62, 62, 64, 62, 62, 64 ), # Wireless + Wired total 30 or 64 - "CFG_WIRED" : ( 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 0, 2, 2, 0 ), + "CFG_WIRELESS" : ( 0, 28, 28, 28, 28, 28, 29, 29, 62, 62, 62, 62, 62, 64, 62, 62, 64 ), # Wireless + Wired total 30 or 64 + "CFG_WIRED" : ( 0, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 0, 2, 2, 0 ), "CFG_AUTO_ENROLL" : ( False, False, False, True, True, True, True, True, True, True, True, True, True, False, True, True, False ), # 360 and 360R cannot autoenroll to Powerlink "CFG_AUTO_SYNCTIME" : ( False, False, False, True, True, True, True, True, True, True, True, True, True, True, True, True, True ), # Assume 360 and 360R can auto sync time "CFG_POWERMASTER" : ( False, False, False, False, False, False, False, True, True, True, True, True, True, True, True, True, True ), # Panels that use and respond to the additional PowerMaster Messages @@ -1804,7 +1804,7 @@ async def _keep_alive_and_watchdog_timer(self): elif len(self.pmExpectedResponse) > 0 and self.expectedResponseTimeout >= RESPONSE_TIMEOUT: # Expected response timeouts are only a problem when in Powerlink Mode as we expect a response # But in all modes, give the panel a _triggerRestoreStatus - if len(self.pmExpectedResponse) == 1 and self.pmExpectedResponse[0] == ACK_MESSAGE: + if len(self.pmExpectedResponse) == 1 and ACK_MESSAGE in self.pmExpectedResponse: pass # If it's only for an acknowledge response then ignore it else: st = '[{}]'.format(', '.join(hex(x) for x in self.pmExpectedResponse))