From 6ba83136094414b1f6d48c2b10a74ed853436b8e Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 28 Apr 2022 07:54:49 +0200 Subject: [PATCH] Fixed light not turning off --- src/philips_hue_counter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/philips_hue_counter.py b/src/philips_hue_counter.py index a71810e..aa23f87 100644 --- a/src/philips_hue_counter.py +++ b/src/philips_hue_counter.py @@ -225,8 +225,8 @@ def set_light_state(target_light_state: bool) -> bool: # Adjust light as necessary target_scene = get_scene_for_time(datetime.now().time()) - # Set to specific scene if exists - if target_scene: + if target_light_state and target_scene: + # Set to specific scene if exists hue.set_group_scene(hue_conf['light_group'], target_scene) logging.debug( f'Light state changed to {target_light_state} with scene {target_scene}')