mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
fix bug in cli.state
This commit is contained in:
parent
2976c453ac
commit
1779e6e122
@ -182,15 +182,13 @@ def state(ctx, dev: SmartDevice):
|
||||
fg="green" if dev.sync.is_on() else "red",
|
||||
)
|
||||
)
|
||||
if dev.num_children > 0:
|
||||
is_on = dev.sync.get_is_on()
|
||||
if dev.is_strip:
|
||||
for plug in range(dev.plugs):
|
||||
is_on = plug.sync.get_is_on()
|
||||
alias = plug.sync.get_alias()
|
||||
click.echo(
|
||||
click.style(
|
||||
" * {} state: {}".format(
|
||||
alias, ("ON" if is_on else "OFF")
|
||||
),
|
||||
" * {} state: {}".format(alias, ("ON" if is_on else "OFF")),
|
||||
fg="green" if is_on else "red",
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user