Skip to content

Commit

Permalink
makes the plugin starting and ready
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 committed Nov 27, 2023
1 parent 5542b81 commit 2aaf7b5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Modules/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")
10 changes: 5 additions & 5 deletions Modules/zigbeeVersionTable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 2 additions & 1 deletion Z4D_decoders/z4d_decoder_Write_Attribute_Request.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 5 additions & 4 deletions Z4D_decoders/z4d_decoder_Zigate_Firmware_Version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))



Expand Down

0 comments on commit 2aaf7b5

Please sign in to comment.