Fix xncp_set_manual_source_route keyword arguments#715
Open
TheJulianJES wants to merge 1 commit intozigpy:devfrom
Open
Fix xncp_set_manual_source_route keyword arguments#715TheJulianJES wants to merge 1 commit intozigpy:devfrom
xncp_set_manual_source_route keyword arguments#715TheJulianJES wants to merge 1 commit intozigpy:devfrom
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_routingoption to be turned on in thebellowssection. This is not really related to the normalsource_routingoption.)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_routewithnwk=/relays=(the kwargs of the siblingset_source_route), but the XNCP wrapper takesdestination=/route=. On firmware that advertises theMANUAL_SOURCE_ROUTEfeature with manual source routing enabled, this raisedTypeErrorinstead 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 againstxncp_set_manual_source_routeso the assertion checks the real signature.