Skip to content

Commit 765d402

Browse files
committed
continuing to bug hunt
1 parent 8411ba6 commit 765d402

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Star_Fragment_Lamp/code.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def sun_countdown(sun_event):
153153
print(sunset)
154154
print()
155155
# less than an hour until sunset...
156-
if hours_until_sunset == 0:
156+
if hours_until_sunset == 0 or hours_until_sunset == 23:
157157
# check every minute
158158
time_check = 60000
159159
# map color to ramp up in brightness over the course of the final hour
@@ -183,18 +183,18 @@ def sun_countdown(sun_event):
183183
today = now.tm_mday
184184
looking_for_sunrise = True
185185
# begin tracking the incoming sunrise
186-
elif looking_for_sunrise:
186+
if looking_for_sunrise:
187187
print("pinging Open-Meteo")
188188
sunrise, sunset = sun_clock()
189-
(total_until_set, hours_until_sunset,
190-
mins_until_sunset, now) = sun_countdown(rise_time)
189+
(total_until_rise, hours_until_sunrise,
190+
mins_until_sunrise, now) = sun_countdown(rise_time)
191191
print("%d hour(s) until sunrise" % hours_until_sunrise)
192192
print("%d minutes(s) until sunrise" % mins_until_sunrise)
193193
print(sunrise)
194194
print(now)
195195
print()
196196
# less than an hour until sunset...
197-
if hours_until_sunrise == 0:
197+
if hours_until_sunrise == 0 or hours_until_sunrise == 23:
198198
# check every minute
199199
time_check = 60000
200200
# map color to decrease brightness over the course of the final hour

0 commit comments

Comments
 (0)