From f3365ed4510d27ff2526b8cbaa156dc770a72480 Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Thu, 24 Sep 2020 11:21:55 -0400 Subject: [PATCH 1/2] Guard against empty node descriptors --- custom_components/zha_map/neighbour.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/custom_components/zha_map/neighbour.py b/custom_components/zha_map/neighbour.py index e2af782..bb6d6e5 100644 --- a/custom_components/zha_map/neighbour.py +++ b/custom_components/zha_map/neighbour.py @@ -61,7 +61,10 @@ def _update_info(self): self.nwk = "0x{:04x}".format(self.device.nwk) self.model = self.device.model self.manufacturer = self.device.manufacturer - self.device_type = self.device.node_desc.logical_type.name + if self.device.node_desc.is_valid: + self.device_type = self.device.node_desc.logical_type.name + else: + self.device_type = "unknown" @classmethod async def scan_device(cls, device): From 7144ebfded36ef67768d890f87c92c3f16382191 Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Wed, 7 Oct 2020 19:08:58 -0400 Subject: [PATCH 2/2] Syncup with changes in zigpy==0.26.0 --- custom_components/zha_map/neighbour.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/zha_map/neighbour.py b/custom_components/zha_map/neighbour.py index bb6d6e5..aaefba7 100644 --- a/custom_components/zha_map/neighbour.py +++ b/custom_components/zha_map/neighbour.py @@ -43,12 +43,12 @@ def new_from_record(cls, record): r.pan_id = str(record.extended_pan_id) r.ieee = record.ieee - r.device_type = record.struct.device_type.name - r.rx_on_when_idle = record.struct.rx_on_when_idle.name - if record.struct.relationship == zdo_t.Neighbor.RelationShip.NoneOfTheAbove: + r.device_type = record.device_type.name + r.rx_on_when_idle = record.rx_on_when_idle.name + if record.relationship == zdo_t.Neighbor.RelationShip.NoneOfTheAbove: r.relation = "None_of_the_above" else: - r.relation = record.struct.relationship.name + r.relation = record.relationship.name r.new_joins_accepted = record.permit_joining.name r.depth = record.depth r.lqi = record.lqi