bettwaage-sidequest #2

Merged
m.giller merged 38 commits from bettwaage-sidequest into master 2024-06-07 23:38:56 +02:00
Showing only changes of commit c4e302aef2 - Show all commits

View file

@ -21,7 +21,7 @@ show_scale_countdown: int = 0 # Number of updates for the scale, until return t
average_person_weight: float = 75 average_person_weight: float = 75
is_warning_active: bool = False is_warning_active: int = 0
leg_capacity_limit_patterns = [ leg_capacity_limit_patterns = [
{"limit": 80, "pattern": 110, "duration": 1000}, {"limit": 80, "pattern": 110, "duration": 1000},
{"limit": 90, "pattern": 110, "duration": 250}, {"limit": 90, "pattern": 110, "duration": 250},
@ -61,15 +61,18 @@ def is_capacity_reached() -> bool:
global is_warning_active global is_warning_active
if highest_limit is None: if highest_limit is None:
if is_warning_active: if is_warning_active:
is_warning_active = False is_warning_active = 0
show_time() show_time()
return return False
is_warning_active = True if is_warning_active != highest_limit["limit"]:
is_warning_active = highest_limit["limit"]
r.post( r.post(
f"{matrix_clock_api}/pattern?pattern={highest_limit['pattern']}&step_ms={highest_limit['duration']}" f"{matrix_clock_api}/pattern?pattern={highest_limit['pattern']}&step_ms={highest_limit['duration']}"
) )
return True
def check_for_change(): def check_for_change():
# Check for capicity limits # Check for capicity limits