Skip to content

Commit 7f25c22

Browse files
authored
PyPortal_Halloween_Countdown: update to settings.toml
1 parent 76cd05b commit 7f25c22

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

  • PyPortal/PyPortal_Halloween_Countdown

PyPortal/PyPortal_Halloween_Countdown/code.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,14 @@
1717
"""
1818

1919
#pylint:disable=invalid-name
20+
import os
2021
import time
2122
import random
2223
import board
2324
from adafruit_pyportal import PyPortal
2425
from adafruit_bitmap_font import bitmap_font
2526
from adafruit_display_text.label import Label
2627

27-
try:
28-
from secrets import secrets
29-
except ImportError:
30-
print("""WiFi settings are kept in secrets.py, please add them there!
31-
the secrets dictionary must contain 'ssid' and 'password' at a minimum""")
32-
raise
33-
3428
# The time of the thing!
3529
EVENT_YEAR = 2019
3630
EVENT_MONTH = 10
@@ -89,7 +83,7 @@
8983
if (not refresh_time) or (time.monotonic() - refresh_time) > 3600:
9084
try:
9185
print("Getting time from internet!")
92-
pyportal.get_local_time(location=secrets['timezone'])
86+
pyportal.get_local_time(location=os.getenv("TIMEZONE"))
9387
refresh_time = time.monotonic()
9488
except RuntimeError as e:
9589
print("Some error occured, retrying! -", e)

0 commit comments

Comments
 (0)