File tree Expand file tree Collapse file tree
PyPortal/PyPortal_Halloween_Countdown Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717"""
1818
1919#pylint:disable=invalid-name
20+ import os
2021import time
2122import random
2223import board
2324from adafruit_pyportal import PyPortal
2425from adafruit_bitmap_font import bitmap_font
2526from 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!
3529EVENT_YEAR = 2019
3630EVENT_MONTH = 10
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 )
You can’t perform that action at this time.
0 commit comments