diff --git a/tests/test_commands.py b/tests/test_commands.py index 705e09b2..d31c38a8 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -559,3 +559,19 @@ def test_neighbors_missing_payload(): Src=0x821F, Status=t.ZDOStatus.NOT_SUPPORTED, ) + + +def test_routes_missing_payload(): + frame = frames.GeneralFrame( + header=t.CommandHeader( + id=0xB2, + subsystem=t.Subsystem.ZDO, + type=t.CommandType.AREQ, + ), + data=b"\x85\xCC\x84", + ) + + assert c.ZDO.MgmtRtgRsp.Callback.from_frame(frame) == c.ZDO.MgmtRtgRsp.Callback( + Src=0xCC85, + Status=t.ZDOStatus.NOT_SUPPORTED, + ) diff --git a/zigpy_znp/commands/zdo.py b/zigpy_znp/commands/zdo.py index 6c1abbe6..982ee5f8 100644 --- a/zigpy_znp/commands/zdo.py +++ b/zigpy_znp/commands/zdo.py @@ -1194,7 +1194,7 @@ class ZDO(t.CommandsBase, subsystem=t.Subsystem.ZDO): t.Param( "Status", t.ZDOStatus, "Status is either Success (0) or Failure (1)" ), - t.Param("Routes", zigpy.zdo.types.Routes, "Routes"), + t.Param("Routes", zigpy.zdo.types.Routes, "Routes", optional=True), ), )