Skip to content

Commit d8361ea

Browse files
authored
Merge pull request #2777 from adafruit/dhalbert-patch-13
PyPortal_Quarantine_Clock: update to settings.toml
2 parents 507000f + fc80f36 commit d8361ea

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

  • PyPortal/PyPortal_Quarantine_Clock

PyPortal/PyPortal_Quarantine_Clock/code.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5+
import os
56
import time
67
import board
78
import busio
@@ -13,13 +14,6 @@
1314
from adafruit_bitmap_font import bitmap_font
1415
from adafruit_display_text import label
1516

16-
try:
17-
from secrets import secrets
18-
except ImportError:
19-
print("""WiFi settings are kept in secrets.py, please add them there!
20-
the secrets dictionary must contain 'ssid' and 'password' at a minimum""")
21-
raise
22-
2317
# Label colors
2418
LABEL_DAY_COLOR = 0xFFFFFF
2519
LABEL_TIME_COLOR = 0x2a8eba
@@ -88,7 +82,7 @@
8882
if (not refresh_time) or (time.monotonic() - refresh_time) > 3600:
8983
try:
9084
print("Getting new time from internet...")
91-
pyportal.get_local_time(secrets['timezone'])
85+
pyportal.get_local_time(os.getenv("TIMEZONE"))
9286
refresh_time = time.monotonic()
9387
# set the_time
9488
the_time = time.localtime()

0 commit comments

Comments
 (0)