mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
cli: add human-friendly printout when calling temperature on non-supported devices (#196)
* Bug Fix Temperature is not supported on plugs * Efficiency on support errors * Update kasa/cli.py Co-authored-by: Teemu R. <tpr@iki.fi> Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
parent
7c9d21af7a
commit
f8e7258b93
@ -345,6 +345,9 @@ async def brightness(dev: SmartBulb, brightness: int, transition: int):
|
||||
async def temperature(dev: SmartBulb, temperature: int, transition: int):
|
||||
"""Get or set color temperature."""
|
||||
await dev.update()
|
||||
if not dev.is_variable_color_temp:
|
||||
click.echo("Device does not support color temperature")
|
||||
return
|
||||
if temperature is None:
|
||||
click.echo(f"Color temperature: {dev.color_temp}")
|
||||
valid_temperature_range = dev.valid_temperature_range
|
||||
|
Loading…
Reference in New Issue
Block a user