Skip to content

Commit e6d3e0d

Browse files
committed
Fix ZDO command definitions and kwarg names
1 parent f4c2aa7 commit e6d3e0d

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

tests/application/test_joining.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,7 @@ async def test_unknown_device_discovery(device, make_application, mocker):
554554
Status=t.ZDOStatus.SUCCESS,
555555
IEEE=existing_ieee,
556556
NWK=existing_nwk + 1,
557+
NumAssoc=0,
557558
Index=0,
558559
Devices=[],
559560
),
@@ -591,6 +592,7 @@ async def test_unknown_device_discovery(device, make_application, mocker):
591592
Status=t.ZDOStatus.SUCCESS,
592593
IEEE=new_ieee,
593594
NWK=new_nwk,
595+
NumAssoc=0,
594596
Index=0,
595597
Devices=[],
596598
),

zigpy_znp/commands/zdo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@ class ZDO(t.CommandsBase, subsystem=t.Subsystem.ZDO):
939939
),
940940
t.Param("IEEE", t.EUI64, "Extended address of the source device"),
941941
t.Param("NWK", t.NWK, "Short address of the source device"),
942+
t.Param("NumAssoc", t.uint8_t, "Number of associated devices"),
942943
t.Param(
943944
"Index",
944945
t.uint8_t,
@@ -958,6 +959,7 @@ class ZDO(t.CommandsBase, subsystem=t.Subsystem.ZDO):
958959
),
959960
t.Param("IEEE", t.EUI64, "Extended address of the source device"),
960961
t.Param("NWK", t.NWK, "Short address of the source device"),
962+
t.Param("NumAssoc", t.uint8_t, "Number of associated devices"),
961963
t.Param(
962964
"Index",
963965
t.uint8_t,

zigpy_znp/zigbee/application.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,12 @@ def _bind_callbacks(self) -> None:
671671
self.on_intentionally_unhandled_message,
672672
)
673673

674+
# These are responses to a broadcast but we ignore all but the first
675+
self._znp.callback_for_response(
676+
c.ZDO.IEEEAddrRsp.Callback(partial=True),
677+
self.on_intentionally_unhandled_message,
678+
)
679+
674680
def on_intentionally_unhandled_message(self, msg: t.CommandBase) -> None:
675681
"""
676682
Some commands are unhandled but frequently sent by devices on the network. To

zigpy_znp/zigbee/zdo_converters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
ZDOCmd.NWK_addr_rsp,
3838
{
3939
"Status": rsp.Status,
40-
"IEEE": rsp.IEEE,
40+
"IEEEAddr": rsp.IEEE,
4141
"NWKAddr": rsp.NWK,
4242
"NumAssocDev": len(rsp.Devices),
4343
"StartIndex": rsp.Index,
44-
"NWKAddrAssocDevList": rsp.Devices,
44+
"NWKAddressAssocDevList": rsp.Devices, # XXX: this is inconsistent
4545
},
4646
)
4747
),

0 commit comments

Comments
 (0)