Skip to content

Commit d876a2a

Browse files
authored
Merge pull request #5 from slootsky/feature/get_local_time_ignores_location
Make get_local_time use location parameter if it exists
2 parents 64dc521 + ce717a4 commit d876a2a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_portalbase/network.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def get_local_time(self, location=None):
169169
"\n\nOur time service requires a login/password to rate-limit. Please register for a free adafruit.io account and place the user/key in your secrets file under 'aio_username' and 'aio_key'" # pylint: disable=line-too-long
170170
) from KeyError
171171

172-
location = secrets.get("timezone", location)
172+
if location is None:
173+
location = secrets.get("timezone", location)
173174
if location:
174175
print("Getting time for timezone", location)
175176
api_url = (TIME_SERVICE + "&tz=%s") % (aio_username, aio_key, location)

0 commit comments

Comments
 (0)