mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
9cffbe9e48
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 |
||
---|---|---|
.. | ||
fixtures | ||
smart | ||
__init__.py | ||
conftest.py | ||
device_fixtures.py | ||
discovery_fixtures.py | ||
fakeprotocol_iot.py | ||
fakeprotocol_smart.py | ||
fixtureinfo.py | ||
test_aestransport.py | ||
test_bulb.py | ||
test_childdevice.py | ||
test_cli.py | ||
test_common_modules.py | ||
test_device_factory.py | ||
test_device_type.py | ||
test_device.py | ||
test_deviceconfig.py | ||
test_dimmer.py | ||
test_discovery.py | ||
test_emeter.py | ||
test_feature.py | ||
test_httpclient.py | ||
test_iotdevice.py | ||
test_klapprotocol.py | ||
test_lightstrip.py | ||
test_plug.py | ||
test_protocol.py | ||
test_readme_examples.py | ||
test_smartdevice.py | ||
test_smartprotocol.py | ||
test_strip.py | ||
test_usage.py |