Skip to content

Commit 57b5720

Browse files
committed
Added break to color cycle for when light is turned off
1 parent 0826d8d commit 57b5720

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pl_worker/porch_light.py

+5
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ def change_light_color():
118118
level = 100 # Always full brightness
119119
sat = hsl[2] * 100
120120
logging.debug(f"HUE={hue} SAT={sat}")
121+
122+
if light.switch != "on": # Exit function if light was turned off after start of run
123+
logging.info("Color Change Function DONE!")
124+
break
125+
121126
light.set_color(hue=hue, saturation=sat, level=level)
122127
time.sleep(int(os.getenv("CYCLE_TIME")))
123128
if os.getenv("PL_TEST_MODE") == str(True):

0 commit comments

Comments
 (0)