Repository navigation
Conversation
The reconnect, reboot, wps, devices and calls subcommands were registered as positional arguments with action="store_true". Python 3.14 rejects zero-arg actions on positional arguments, raising ValueError at startup, so the CLI failed for every invocation. Capture the selected subcommand via add_subparsers(dest="command") instead and drop the bogus positionals.
Wkhanex
reviewed
Oct 12, 2026
There was a problem hiding this comment.
Additional dispatch regression check on this head: the five no-argument commands and both on/off variants of wifi, guest-wifi and office-wifi parsed correctly (11 combinations), with command identifying the selected subparser and the Wi-Fi values preserved. Extracted check_args also awaited exactly the intended mocked route for wps, reconnect and reboot. This supports replacing the positional store_true flags with the subparser destination. Consider keeping these parser/AsyncMock checks as tests so a future command rename cannot disconnect parsing from dispatch. I ran these checks on Python 3.12; no real router was contacted and Python 3.14/full package tests were not run.
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.
The
reconnect,reboot,wps,devicesandcallssubcommands were registered as positional arguments withaction="store_true". Python 3.14's argparse now rejects actions withnargs == 0on positional arguments, so the CLI raisedValueError: action 'store_true' is not valid for positional argumentsat startup for every invocation.These positionals only existed to capture which subcommand was selected, since the subparsers had no
dest. This change captures the command viaadd_subparsers(dest="command")and drops the bogus positionals, which is the idiomatic argparse approach.Verified argument parsing and
--helpoutput on Python 3.12, 3.13 and 3.14.