@@ -153,7 +153,7 @@ def sun_countdown(sun_event):
153
153
print (sunset )
154
154
print ()
155
155
# less than an hour until sunset...
156
- if hours_until_sunset == 0 :
156
+ if hours_until_sunset == 0 or hours_until_sunset == 23 :
157
157
# check every minute
158
158
time_check = 60000
159
159
# map color to ramp up in brightness over the course of the final hour
@@ -183,18 +183,18 @@ def sun_countdown(sun_event):
183
183
today = now .tm_mday
184
184
looking_for_sunrise = True
185
185
# begin tracking the incoming sunrise
186
- elif looking_for_sunrise :
186
+ if looking_for_sunrise :
187
187
print ("pinging Open-Meteo" )
188
188
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 )
191
191
print ("%d hour(s) until sunrise" % hours_until_sunrise )
192
192
print ("%d minutes(s) until sunrise" % mins_until_sunrise )
193
193
print (sunrise )
194
194
print (now )
195
195
print ()
196
196
# less than an hour until sunset...
197
- if hours_until_sunrise == 0 :
197
+ if hours_until_sunrise == 0 or hours_until_sunrise == 23 :
198
198
# check every minute
199
199
time_check = 60000
200
200
# map color to decrease brightness over the course of the final hour
0 commit comments