diff --git a/PyPortal/PyPortal_Quarantine_Clock/code.py b/PyPortal/PyPortal_Quarantine_Clock/code.py index 347f38665..06144e5f8 100755 --- a/PyPortal/PyPortal_Quarantine_Clock/code.py +++ b/PyPortal/PyPortal_Quarantine_Clock/code.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: MIT +import os import time import board import busio @@ -13,13 +14,6 @@ from adafruit_pyportal import PyPortal from adafruit_bitmap_font import bitmap_font from adafruit_display_text import label -try: - from secrets import secrets -except ImportError: - print("""WiFi settings are kept in secrets.py, please add them there! -the secrets dictionary must contain 'ssid' and 'password' at a minimum""") - raise - # Label colors LABEL_DAY_COLOR = 0xFFFFFF LABEL_TIME_COLOR = 0x2a8eba @@ -88,7 +82,7 @@ while True: if (not refresh_time) or (time.monotonic() - refresh_time) > 3600: try: print("Getting new time from internet...") - pyportal.get_local_time(secrets['timezone']) + pyportal.get_local_time(os.getenv("TIMEZONE")) refresh_time = time.monotonic() # set the_time the_time = time.localtime()