fix bug in cli.state

This commit is contained in:
Bas Nijholt 2019-11-15 16:07:04 +01:00
parent 2976c453ac
commit 1779e6e122

View File

@ -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",
)
)