mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-01-08 22:07:06 +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",
|
fg="green" if dev.sync.is_on() else "red",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if dev.num_children > 0:
|
if dev.is_strip:
|
||||||
is_on = dev.sync.get_is_on()
|
|
||||||
for plug in range(dev.plugs):
|
for plug in range(dev.plugs):
|
||||||
|
is_on = plug.sync.get_is_on()
|
||||||
alias = plug.sync.get_alias()
|
alias = plug.sync.get_alias()
|
||||||
click.echo(
|
click.echo(
|
||||||
click.style(
|
click.style(
|
||||||
" * {} state: {}".format(
|
" * {} state: {}".format(alias, ("ON" if is_on else "OFF")),
|
||||||
alias, ("ON" if is_on else "OFF")
|
|
||||||
),
|
|
||||||
fg="green" if is_on else "red",
|
fg="green" if is_on else "red",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user