Improved handling of show_time
This commit is contained in:
parent
35443b7cc8
commit
33617ec7a3
1 changed files with 6 additions and 6 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue