diff --git a/src/endpoints/handlers/bett.py b/src/endpoints/handlers/bett.py index fd07f9e..be627d7 100644 --- a/src/endpoints/handlers/bett.py +++ b/src/endpoints/handlers/bett.py @@ -91,9 +91,6 @@ def check_for_change(): if show_scale_countdown % 3 == 0: show_scale(latest["total"] - empty_weight) show_scale_countdown -= 1 - elif show_scale_countdown == 0: - show_scale_countdown -= 1 - show_time() # Is triggered? delta = latest["total"] - local_history[-2]["total"] @@ -115,11 +112,14 @@ def check_for_change(): number_of_people = round((latest["total"] - empty_weight) / average_person_weight) logging.info(f"Number of people: {number_of_people}") - if number_of_people == 1 and weight_increased: + # Show scale? + if number_of_people == 1 and weight_increased and show_scale_countdown == 0: show_scale_countdown = 60 # Should be a multiple of 3 - elif number_of_people >= 2 and weight_increased: + else: show_scale_countdown = 0 - show_time() + + # Make room sexy + if number_of_people >= 2 and weight_increased: hue.in_room_activate_scene("Max Zimmer", "Sexy") elif number_of_people == 1 and not weight_increased: hue.in_room_activate_scene("Max Zimmer", "Tageslicht")