Skip to content

Fix xncp_set_manual_source_route keyword arguments#715

Open
TheJulianJES wants to merge 1 commit intozigpy:devfrom
TheJulianJES:tjj/fix_manual_source_route_kwargs
Open

Fix xncp_set_manual_source_route keyword arguments#715
TheJulianJES wants to merge 1 commit intozigpy:devfrom
TheJulianJES:tjj/fix_manual_source_route_kwargs

Conversation

@TheJulianJES
Copy link
Copy Markdown
Contributor

@TheJulianJES TheJulianJES commented May 4, 2026

Proposed change

This makes manual source routing* work for the first time ever...? 😅 (by fixing the names of the provided kwargs).

(*: It's only supported on certain firmware builds and requires the manual_source_routing option to be turned on in the bellows section. This is not really related to the normal source_routing option.)

Additional information

Firmware extensions (as well as the bug) were added with:

TODO

We should probably test the firmware side? Was that ever tested then?

AI summary

The send-packet path called xncp_set_manual_source_route with nwk=/ relays= (the kwargs of the sibling set_source_route), but the XNCP wrapper takes destination=/route=. On firmware that advertises the MANUAL_SOURCE_ROUTE feature with manual source routing enabled, this raised TypeError instead of installing the route.

The existing test mocked the method against the wrong spec (set_source_route), so the bad kwargs validated and the bug went unnoticed. Re-spec the mock against xncp_set_manual_source_route so the assertion checks the real signature.

The send-packet path called `xncp_set_manual_source_route` with `nwk=`/
`relays=` (the kwargs of the sibling `set_source_route`), but the XNCP
wrapper takes `destination=`/`route=`. On firmware that advertises the
`MANUAL_SOURCE_ROUTE` feature with manual source routing enabled, this
raised `TypeError` instead of installing the route.

The existing test mocked the method against the wrong spec
(`set_source_route`), so the bad kwargs validated and the bug went
unnoticed. Re-spec the mock against `xncp_set_manual_source_route` so
the assertion checks the real signature.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (4b97a6d) to head (b41c9f4).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #715   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          61       61           
  Lines        4147     4147           
=======================================
  Hits         4128     4128           
  Misses         19       19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant