diff --git a/tests/test_commands.py b/tests/test_commands.py index e43e3d88..eaa44951 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -543,3 +543,19 @@ class TestSubsystem(t.CommandsBase, subsystem=t.Subsystem.SYS): assert Test.from_frame(frames.GeneralFrame(header=Test.header, data=b"")) == Test( Data=t.Bytes(b"") ) + + +def test_neighbors_missing_payload(): + frame = frames.GeneralFrame( + header=t.CommandHeader( + id=0xB1, + subsystem=t.Subsystem.ZDO, + type=t.CommandType.AREQ, + ), + data=b"\x1F\x82\x84", + ) + + assert c.ZDO.MgmtLqiRsp.Callback.from_frame(frame) == c.ZDO.MgmtLqiRsp.Callback( + Src=0x821F, + Status=t.ZDOStatus.NOT_SUPPORTED, + ) diff --git a/zigpy_znp/commands/zdo.py b/zigpy_znp/commands/zdo.py index 277ed64a..6c1abbe6 100644 --- a/zigpy_znp/commands/zdo.py +++ b/zigpy_znp/commands/zdo.py @@ -1181,7 +1181,7 @@ class ZDO(t.CommandsBase, subsystem=t.Subsystem.ZDO): t.Param( "Status", t.ZDOStatus, "Status is either Success (0) or Failure (1)" ), - t.Param("Neighbors", zigpy.zdo.types.Neighbors, "Neighbors"), + t.Param("Neighbors", zigpy.zdo.types.Neighbors, "Neighbors", optional=True), ), )