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 42
42
RED_ALERT = "Red Alert"
43
43
44
44
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
-
55
45
def gradient (color_one , color_two , blend_weight ):
56
46
"""
57
47
Blend between two colors with a given ratio.
@@ -131,9 +121,9 @@ def timing():
131
121
state_from_orientation ()
132
122
133
123
if current_orientation == 'up' :
134
- activity_duration = minutes_to_seconds ( activity_one )
124
+ activity_duration = activity_one * 60 # Converts seconds to minutes.
135
125
elif current_orientation == 'down' :
136
- activity_duration = minutes_to_seconds ( activity_two )
126
+ activity_duration = activity_two * 60 # Converts seconds to minutes.
137
127
else :
138
128
return
139
129
@@ -155,7 +145,7 @@ def timing_complete():
155
145
156
146
elapsed = time .monotonic () - state_changed
157
147
158
- if elapsed >= minutes_to_seconds (red_alert_delay ):
148
+ if elapsed >= (red_alert_delay * 60 ): # Converts seconds to minutes.
159
149
set_state (RED_ALERT )
160
150
return
161
151
Original file line number Diff line number Diff line change 41
41
RED_ALERT = "Red Alert"
42
42
43
43
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
-
54
44
def gradient (color_one , color_two , blend_weight ):
55
45
"""
56
46
Blend between two colors with a given ratio.
@@ -129,7 +119,7 @@ def timing():
129
119
"""The timing active state."""
130
120
state_from_orientation ()
131
121
132
- activity_duration = minutes_to_seconds ( hydration_reminder )
122
+ activity_duration = hydration_reminder * 60 # Converts minutes to seconds.
133
123
134
124
elapsed = time .monotonic () - state_changed
135
125
@@ -149,7 +139,7 @@ def timing_complete():
149
139
150
140
elapsed = time .monotonic () - state_changed
151
141
152
- if elapsed >= minutes_to_seconds (red_alert_delay ):
142
+ if elapsed >= (red_alert_delay * 60 ): # Converts minutes to seconds.
153
143
set_state (RED_ALERT )
154
144
return
155
145
You can’t perform that action at this time.
0 commit comments