Skip to content

Commit 02baa6d

Browse files
authored
Merge pull request #48 from slootsky/feature/get_local_time_ignores_location_parameter
added check to see if location was None before getting timezone
2 parents bb72568 + b653b88 commit 02baa6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_matrixportal/network.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ def get_local_time(self, location=None):
177177
"\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
178178
) from KeyError
179179

180-
location = secrets.get("timezone", location)
180+
if location is None:
181+
location = secrets.get("timezone")
181182
if location:
182183
print("Getting time for timezone", location)
183184
api_url = (TIME_SERVICE + "&tz=%s") % (aio_username, aio_key, location)

0 commit comments

Comments
 (0)