You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Fetch and "set" the local time of this microcontroller to the local time at the location, using an internet time API.
91
+
:param str location: Your city and country, e.g. ``"New York, US"``.
92
+
"""
93
+
# pylint: enable=line-too-long
94
+
api_url=None
95
+
try:
96
+
aio_username=secrets['aio_username']
97
+
aio_key=secrets['aio_key']
98
+
exceptKeyError:
99
+
raiseKeyError("\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
raiseKeyError("Was unable to lookup the time, try setting secrets['timezone'] according to http://worldtimeapi.org/timezones") # pylint: disable=line-too-long
125
+
126
+
# now clean up
127
+
response.close()
128
+
response=None
129
+
gc.collect()
130
+
returnint(seconds+tzseconds)
90
131
91
132
defcreate_text_areas(configs):
92
133
"""Given a list of area specifications, create and return text areas."""
@@ -135,8 +176,8 @@ def status(self):
135
176
# See https://apidock.com/ruby/DateTime/strftime for full options
"""Fetch and "set" the local time of this microcontroller to the local time at the location, using an internet time API.
190
-
:param str location: Your city and country, e.g. ``"New York, US"``.
191
-
"""
192
-
# pylint: enable=line-too-long
193
-
api_url=None
194
-
try:
195
-
aio_username=secrets['aio_username']
196
-
aio_key=secrets['aio_key']
197
-
exceptKeyError:
198
-
raiseKeyError("\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
raiseKeyError("Was unable to lookup the time, try setting secrets['timezone'] according to http://worldtimeapi.org/timezones") # pylint: disable=line-too-long
224
-
225
-
# now clean up
226
-
response.close()
227
-
response=None
228
-
gc.collect()
229
-
returnint(seconds+tzseconds)
230
-
231
229
# Define callback methods which are called when events occur
0 commit comments