Bugfix in for --skip-if-off

This commit is contained in:
Shy 2017-04-18 18:38:32 +02:00
parent 5c5a404ba5
commit 83dd8fca51

View file

@ -55,12 +55,13 @@ def kitchentext(delay=200, skip_if_off=False, poweron=False, restore=False,
if skip_if_off:
# Stop here if kitchenlight is turned off.
if saved_state[1].payload == b'\x00':
for state in saved_state:
if state.topic == kl.powertopic and state.payload == b'\x00':
verbose and print("Found Kitchenlight turned off and '-i' flag given. Exiting.")
return
# We want to be able to restore the saved Kitchenlight if we receive a
# SIGERM signal. We do this by creating an registering a custom exception
# SIGERM signal. We do this by creating and registering a custom exception
# class.
class KitchenSignalError(Exception):
def __init__(self, signal, frame):