mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-16 07:08:42 +00:00
Add tests and pretty output for HS220, fix minor issues in tests
This commit is contained in:
@@ -26,7 +26,6 @@ pass_dev = click.make_pass_decorator(SmartDevice)
|
||||
help='The host name or IP address of the device to connect to.')
|
||||
@click.option('--alias', envvar="PYHS100_NAME", required=False,
|
||||
help='The device name, or alias, of the device to connect to.')
|
||||
|
||||
@click.option('--debug/--normal', default=False)
|
||||
@click.option('--bulb', default=False, is_flag=True)
|
||||
@click.option('--plug', default=False, is_flag=True)
|
||||
@@ -183,7 +182,10 @@ def emeter(dev, year, month, erase):
|
||||
required=False)
|
||||
@pass_dev
|
||||
def brightness(dev, brightness):
|
||||
"""Get or set brightness. (Bulb Only)"""
|
||||
"""Get or set brightness."""
|
||||
if not dev.is_dimmable:
|
||||
click.echo("This device does not support brightness.")
|
||||
return
|
||||
if brightness is None:
|
||||
click.echo("Brightness: %s" % dev.brightness)
|
||||
else:
|
||||
@@ -263,5 +265,6 @@ def reboot(plug, delay):
|
||||
click.echo("Rebooting the device..")
|
||||
plug.reboot(delay)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
cli()
|
||||
|
||||
Reference in New Issue
Block a user