PyPortal_Quarantine_Clock: update to settings.toml
This commit is contained in:
parent
cf6ffd5ca0
commit
fc80f36526
1 changed files with 2 additions and 8 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue