From ce717a420ebe0ec3158dadec079f4156e954a5b1 Mon Sep 17 00:00:00 2001 From: slootsky Date: Wed, 23 Dec 2020 16:57:58 -0500 Subject: [PATCH] Make get_local_time use location parameter if it exists --- adafruit_portalbase/network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adafruit_portalbase/network.py b/adafruit_portalbase/network.py index 4974b2f..6665de8 100755 --- a/adafruit_portalbase/network.py +++ b/adafruit_portalbase/network.py @@ -169,7 +169,8 @@ def get_local_time(self, location=None): "\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 ) from KeyError - location = secrets.get("timezone", location) + if location is None: + location = secrets.get("timezone", location) if location: print("Getting time for timezone", location) api_url = (TIME_SERVICE + "&tz=%s") % (aio_username, aio_key, location)