Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zigpy_znp/commands/zdo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please pair this with a regression test, the way the identical Neighbors fix in #228 (406b21f) did — that PR added test_neighbors_missing_payload to tests/test_commands.py alongside the one-line schema change.

Dropping this in right after test_neighbors_missing_payload, using the real frame from #278, is enough:

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,
    )

I ran it both ways: it passes on this branch, and on dev it fails with the exact ValueError from #278's traceback (zigpy_znp/types/commands.py:424).

),
)

Expand Down
Loading