diff --git a/src/endpoints/handlers/bett.py b/src/endpoints/handlers/bett.py index 3a6baad..a383cea 100644 --- a/src/endpoints/handlers/bett.py +++ b/src/endpoints/handlers/bett.py @@ -22,7 +22,7 @@ show_scale_countdown: int = 0 # Number of updates for the scale, until return t average_person_weight: float = 75 -is_warning_active: int = 0 +is_warning_active: int = -1 leg_capacity_limit_patterns = [ {"limit": 80, "pattern": 110, "duration": 1000}, {"limit": 90, "pattern": 110, "duration": 250}, @@ -87,6 +87,9 @@ def check_for_change(): if show_scale_countdown > 0 and 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"] @@ -116,9 +119,6 @@ def check_for_change(): 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") - else: - show_scale_countdown = 0 - show_time() def add_line_to_bed_history(line: str) -> None: