Skip to content

Commit c9b880a

Browse files
committed
try to get timezone but dont error
1 parent 60abf21 commit c9b880a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_pyportal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,10 @@ def get_local_time(self, location=None):
481481
# pylint: enable=line-too-long
482482
self._connect_esp()
483483
api_url = None
484-
if secrets['timezone']:
484+
try:
485485
location = secrets['timezone']
486+
except:
487+
pass
486488
if location:
487489
print("Getting time for timezone", location)
488490
api_url = TIME_SERVICE_LOCATION + location

0 commit comments

Comments
 (0)