Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions bellows/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,8 @@ async def send_packet(self, packet: zigpy.types.ZigbeePacket) -> None:
]
):
await self._ezsp.xncp_set_manual_source_route(
nwk=packet.dst.address,
relays=packet.source_route,
destination=packet.dst.address,
route=packet.source_route,
)
else:
await self._ezsp.set_source_route(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ async def test_send_packet_unicast_manual_source_route(make_app, packet):
app._ezsp._xncp_features |= FirmwareFeatures.MANUAL_SOURCE_ROUTE

app._ezsp.xncp_set_manual_source_route = AsyncMock(
return_value=None, spec=app._ezsp._protocol.set_source_route
return_value=None, spec=app._ezsp.xncp_set_manual_source_route
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good catch — this spec swap is what makes the rest of the diff meaningful. _protocol.set_source_route accepts nwk/relays, so assert_called_once_with(nwk=..., relays=...) validated cleanly against the bad code and the bug slipped through review of #611. With the spec now bound to the real wrapper signature (destination/route), the assertion below actually exercises the kwarg-passing pathway.

)

packet.source_route = [0x0001, 0x0002]
Expand All @@ -913,8 +913,8 @@ async def test_send_packet_unicast_manual_source_route(make_app, packet):
)

app._ezsp.xncp_set_manual_source_route.assert_called_once_with(
nwk=packet.dst.address,
relays=[0x0001, 0x0002],
destination=packet.dst.address,
route=[0x0001, 0x0002],
)


Expand Down
Loading