diff --git a/Modules/input.py b/Modules/input.py index 9c68b70dd..58011e7e7 100644 --- a/Modules/input.py +++ b/Modules/input.py @@ -139,13 +139,13 @@ def zigbee_receive_message(self, Devices, Data): FrameStart = Data[:2] FrameStop = Data[-2:] if FrameStart != "01" and FrameStop != "03": - self.log_error(f"zigbee_receive_message - received a non-zigate frame Data: {Data} FS/FS = {FrameStart}/{FrameStop}") + self.log.logging("Input", "Error", f"zigbee_receive_message - received a non-zigate frame Data: {Data} FS/FS = {FrameStart}/{FrameStop}") return MsgType, MsgData, MsgLQI = extract_message_infos(self, Data) self.Ping["Nb Ticks"] = 0 # We receive a valid packet - self.log_debug(f"ZigateRead - MsgType: {MsgType}, Data: {MsgData}, LQI: {int(MsgLQI, 16)}") + self.log.logging("Input", "Debug", f"ZigateRead - MsgType: {MsgType}, Data: {MsgData}, LQI: {int(MsgLQI, 16)}") if MsgType == "8002": # Let's try to see if we can decode it, and then get a new MsgType @@ -161,13 +161,13 @@ def _decode_message(self, MsgType, Devices, Data, MsgData, MsgLQI): if MsgType in DECODERS: decoding_method = DECODERS[MsgType] - decoding_method(Devices, MsgData, MsgLQI) + decoding_method(self, Devices, MsgData, MsgLQI) elif MsgType == "8002": - Decode8002(Devices, Data, MsgData, MsgLQI) + Decode8002(self, Devices, Data, MsgData, MsgLQI) elif MsgType == "8011": - Decode8011(Devices, MsgData, MsgLQI) + Decode8011(self, Devices, MsgData, MsgLQI) else: - self.log_error(f"_decode_message - not found for {MsgType}") + self.log.logging("Input", "Error", f"_decode_message - not found for {MsgType}") diff --git a/Modules/zigbeeVersionTable.py b/Modules/zigbeeVersionTable.py index 5fa0b0e66..5110a3306 100644 --- a/Modules/zigbeeVersionTable.py +++ b/Modules/zigbeeVersionTable.py @@ -32,19 +32,19 @@ def set_display_firmware_version( self ): if 0 <= int(self.ControllerData["Branch Version"]) < 20: - self.pluginParameters["DisplayFirmwareVersion"] = "Zigate - %s" % self.ControllerData["Minor Version"] + self.pluginParameters["Firmware Version"] = "Zigate - %s" % self.ControllerData["Minor Version"] elif 20 <= int(self.ControllerData["Branch Version"]) < 30: # ZNP - self.pluginParameters["DisplayFirmwareVersion"] = "Znp - %s" % self.ControllerData["Minor Version"] + self.pluginParameters["Firmware Version"] = "Znp - %s" % self.ControllerData["Minor Version"] elif 30 <= int(self.ControllerData["Branch Version"]) < 40: # Silicon Labs - self.pluginParameters["DisplayFirmwareVersion"] = "Ezsp - %s" %self.ControllerData["Minor Version"] + self.pluginParameters["Firmware Version"] = "Ezsp - %s" %self.ControllerData["Minor Version"] elif 40 <= int(self.ControllerData["Branch Version"]) < 50: # deCONZ - self.pluginParameters["DisplayFirmwareVersion"] = "deCONZ - %s" %self.ControllerData["Minor Version"] + self.pluginParameters["Firmware Version"] = "deCONZ - %s" %self.ControllerData["Minor Version"] else: - self.pluginParameters["DisplayFirmwareVersion"] = "UNK - %s" % self.ControllerData["Minor Version"] + self.pluginParameters["Firmware Version"] = "UNK - %s" % self.ControllerData["Minor Version"] diff --git a/Z4D_decoders/z4d_decoder_Write_Attribute_Request.py b/Z4D_decoders/z4d_decoder_Write_Attribute_Request.py index 9a3990fc8..8dfa3c920 100644 --- a/Z4D_decoders/z4d_decoder_Write_Attribute_Request.py +++ b/Z4D_decoders/z4d_decoder_Write_Attribute_Request.py @@ -1,6 +1,7 @@ -from Modules.tools import timeStamped, updLQI from Modules.domoTools import lastSeenUpdate +from Modules.tools import timeStamped, updLQI + def Decode0110(self, Devices, MsgData, MsgLQI): self.log.logging('Input', 'Debug', 'Decode0110 - message: %s' % MsgData) diff --git a/Z4D_decoders/z4d_decoder_Zigate_Firmware_Version.py b/Z4D_decoders/z4d_decoder_Zigate_Firmware_Version.py index 9c0d66043..ec1187132 100644 --- a/Z4D_decoders/z4d_decoder_Zigate_Firmware_Version.py +++ b/Z4D_decoders/z4d_decoder_Zigate_Firmware_Version.py @@ -31,17 +31,19 @@ def Decode8010(self, Devices, MsgData, MsgLQI): self.log.logging('Input', 'Status', 'Untested Zigbee adapter model. If this is a Sonoff USB Dongle E that is a known issue, otherwise, please report to the Zigbee for Domoticz team') self.pluginParameters['CoordinatorModel'] = FIRMWARE_BRANCH[self.FirmwareBranch] elif firmware_branch_int == 11: - self.HandleFirmwareBranch11() + HandleFirmwareBranch11(self) elif firmware_branch_int >= 20: - self.HandleFirmwareBranch20() + HandleFirmwareBranch20(self) else: self.log.logging('Input', 'Status', f'{FIRMWARE_BRANCH[self.FirmwareBranch]}') version = '' self.log.logging('Input', 'Status', f'Installer Version Number: {self.FirmwareVersion}') self.log.logging('Input', 'Status', f'Branch Version: ==> {FIRMWARE_BRANCH[self.FirmwareBranch]} <==') - self.UpdateControllerData() + UpdateControllerData(self) + set_display_firmware_version( self ) + if self.webserver: self.webserver.UpdateFirmware(self.FirmwareVersion) self.ControllerLink.UpdateZiGate_HW_Version(self.ZiGateModel) @@ -54,7 +56,6 @@ def Decode8010(self, Devices, MsgData, MsgLQI): if self.log: self.log.loggingUpdateFirmware(self.FirmwareVersion, self.FirmwareMajorVersion) - self.PDMready = True def HandleFirmwareBranch11(self): diff --git a/plugin.py b/plugin.py index 2fda29118..321a8a94a 100644 --- a/plugin.py +++ b/plugin.py @@ -1307,7 +1307,7 @@ def zigateInit_Phase3(self): elif int(self.FirmwareBranch) >= 20: self.log.logging( "Plugin", "Status", "Plugin with Zigpy, Coordinator %s firmware %s correctly initialized" % ( - self.pluginParameters["CoordinatorModel"], self.pluginParameters["DisplayFirmwareVersion"])) + self.pluginParameters["CoordinatorModel"], self.pluginParameters["Firmware Version"]))