-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend cli to allow defining --child across all relevant commands #769
Comments
This was referenced Feb 19, 2024
This is not really that necessary for the .0 release (if at all?), so I removed the milestone but keep this open just in case we want to revisit it. |
Also removed from the 0.7 META series |
rytilahti
pushed a commit
that referenced
this issue
Jul 2, 2024
Adds a new decorator that adds child options to a command and gets the child device if the options are set. - Single definition of options and error handling - Adds options automatically to command - Backwards compatible with `--index` and `--name` - `--child` allows for id and alias for ease of use - Omitting a value for `--child` gives an interactive prompt Implements private `_update` to allow the CLI to patch a child `update` method to call the parent device `update`. Example help output: ``` $ kasa brightness --help Usage: kasa brightness [OPTIONS] [BRIGHTNESS] Get or set brightness. Options: --transition INTEGER --child, --name TEXT Child ID or alias for controlling sub- devices. If no value provided will show an interactive prompt allowing you to select a child. --child-index, --index INTEGER Child index controlling sub-devices --help Show this message and exit. ``` Fixes #769
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment, only
feature
andcommand
commands accept--child
.Other relevant commands (on/off, brightness, color temperature, ..) should also accept defining which device is being controlled,
perhaps the best way would be to move the option to be available for all commands?
The text was updated successfully, but these errors were encountered: