Skip to content

Commit 715225e

Browse files
committed
fix boot bug
1 parent 356a378 commit 715225e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

PyPortal_Wakeup_Light/wake_up_light.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
pyportal.splash.append(wakeup_time_textarea)
8585
pyportal.splash.append(light_on_time_textarea)
8686

87+
try:
88+
print("Getting time from internet!")
89+
pyportal.get_local_time()
90+
except RuntimeError as e:
91+
print("Some error occured, retrying! -", e)
92+
8793
# parse given time string into hour minute and AM_PM elements
8894
def parseTime(time_before):
8995
hours_before, minutes_before = time_before.split(":")
@@ -211,8 +217,6 @@ def subtract30min(day): # subtract 30 min
211217
start_light_time = subtract30min(wake_up_day)
212218
# If current day is same as wake up day and
213219
# wake up time - 30 minutes equals current time, start the light
214-
print("Wake up day: ", wake_up_day, "Current Day: ", time_now[6])
215-
print("Time: ", time_str_text, "start light time: ", start_light_time)
216220
if wake_up_day == time_now[6] and time_str_text == start_light_time:
217221
print("Starting wake up light")
218222
# turn on backlight

0 commit comments

Comments
 (0)