zigbeefordomoticz / Domoticz-Zigbee

Zigbee plugin for Domoticz. Allow to connect various zigbee controllers like Zigate but also Texas Instrument CC2531, CC13x2, CC26x2 ; Silicon-Labs; deConz based chipset to be connected to Domoticz
GNU General Public License v3.0
100 stars 43 forks source link

zigpy move from handle_message to packet_received #1660

Closed pipiche38 closed 11 months ago

pipiche38 commented 11 months ago

As described here, https://github.com/zigpy/zigpy/discussions/1273, zigpy radio libs deprecated handle_message and so plugin is not compatible with the zigpy releases above 59.0 (included)

the overloaded handle_message in https://github.com/zigbeefordomoticz/Domoticz-Zigbee/blob/7bc1a04ce97671c0099ff7a33a48dce902ee997e/Classes/ZigpyTransport/AppGeneric.py#L174 has to be replaced by packet_receive

https://github.com/zigpy/zigpy/blob/4570a0a47b6f2ad56f922f8cd5861bbfdda25915/zigpy/types/named.py#L563

pipiche38 commented 11 months ago
try:
      device = self.get_device_with_address(packet.src)
except KeyError:
      LOGGER.warning("Unknown device %r", packet.src)
device.radio_details(lqi=packet.lqi, rssi=packet.rssi)
  sender=device,
  profile=packet.profile_id,
  cluster=packet.cluster_id,
  src_ep=packet.src_ep,
  dst_ep=packet.dst_ep,
  message=packet.data.serialize(),
  dst_addressing=packet.dst.addr_mode,
pipiche38 commented 11 months ago

https://github.com/zigbeefordomoticz/Domoticz-Zigbee/tree/zigpy-packet-receive

ca022d7596ccd4f602a0978e93968209dcf3b71a

pipiche38 commented 11 months ago

fix with #1662