File tree Expand file tree Collapse file tree 2 files changed +5
-25
lines changed Expand file tree Collapse file tree 2 files changed +5
-25
lines changed Original file line number Diff line number Diff line change 4242RED_ALERT = "Red Alert"
4343
4444
45- def minutes_to_seconds (minutes ):
46- """
47- Convert minutes to seconds for use with time.monotonic().
48-
49- :param minutes: The number of minutes. Can be a float, e.g. 0.5 for half a minute.
50- """
51- seconds = minutes * 60
52- return seconds
53-
54-
5545def gradient (color_one , color_two , blend_weight ):
5646 """
5747 Blend between two colors with a given ratio.
@@ -131,9 +121,9 @@ def timing():
131121 state_from_orientation ()
132122
133123 if current_orientation == 'up' :
134- activity_duration = minutes_to_seconds ( activity_one )
124+ activity_duration = activity_one * 60 # Converts seconds to minutes.
135125 elif current_orientation == 'down' :
136- activity_duration = minutes_to_seconds ( activity_two )
126+ activity_duration = activity_two * 60 # Converts seconds to minutes.
137127 else :
138128 return
139129
@@ -155,7 +145,7 @@ def timing_complete():
155145
156146 elapsed = time .monotonic () - state_changed
157147
158- if elapsed >= minutes_to_seconds (red_alert_delay ):
148+ if elapsed >= (red_alert_delay * 60 ): # Converts seconds to minutes.
159149 set_state (RED_ALERT )
160150 return
161151
Original file line number Diff line number Diff line change 4141RED_ALERT = "Red Alert"
4242
4343
44- def minutes_to_seconds (minutes ):
45- """
46- Convert minutes to seconds for use with time.monotonic().
47-
48- :param minutes: The number of minutes. Can be a float, e.g. 0.5 for half a minute.
49- """
50- seconds = minutes * 60
51- return seconds
52-
53-
5444def gradient (color_one , color_two , blend_weight ):
5545 """
5646 Blend between two colors with a given ratio.
@@ -129,7 +119,7 @@ def timing():
129119 """The timing active state."""
130120 state_from_orientation ()
131121
132- activity_duration = minutes_to_seconds ( hydration_reminder )
122+ activity_duration = hydration_reminder * 60 # Converts minutes to seconds.
133123
134124 elapsed = time .monotonic () - state_changed
135125
@@ -149,7 +139,7 @@ def timing_complete():
149139
150140 elapsed = time .monotonic () - state_changed
151141
152- if elapsed >= minutes_to_seconds (red_alert_delay ):
142+ if elapsed >= (red_alert_delay * 60 ): # Converts minutes to seconds.
153143 set_state (RED_ALERT )
154144 return
155145
You can’t perform that action at this time.
0 commit comments