Skip to content

Commit 3e0524e

Browse files
committed
more simpler get
1 parent c9b880a commit 3e0524e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

adafruit_pyportal.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,10 +481,7 @@ def get_local_time(self, location=None):
481481
# pylint: enable=line-too-long
482482
self._connect_esp()
483483
api_url = None
484-
try:
485-
location = secrets['timezone']
486-
except:
487-
pass
484+
location = secrets.get('timezone', location)
488485
if location:
489486
print("Getting time for timezone", location)
490487
api_url = TIME_SERVICE_LOCATION + location

0 commit comments

Comments
 (0)