File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Expand file tree Collapse file tree 2 files changed +5
-15
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 @@ -129,7 +129,7 @@ def timing():
129129 """The timing active state."""
130130 state_from_orientation ()
131131
132- activity_duration = minutes_to_seconds ( hydration_reminder )
132+ activity_duration = hydration_reminder * 60 # Converts minutes to seconds.
133133
134134 elapsed = time .monotonic () - state_changed
135135
@@ -149,7 +149,7 @@ def timing_complete():
149149
150150 elapsed = time .monotonic () - state_changed
151151
152- if elapsed >= minutes_to_seconds (red_alert_delay ):
152+ if elapsed >= (red_alert_delay * 60 ): # Converts minutes to seconds.
153153 set_state (RED_ALERT )
154154 return
155155
You can’t perform that action at this time.
0 commit comments