Skip to content

Commit c197393

Browse files
author
brentru
committed
add Adafruit IO Connected Service: Time
1 parent 119c818 commit c197393

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

adafruit_io.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,11 @@ def receive_random_data(self, generator_id):
249249
"""
250250
path = self._compose_path("integrations/words/{0}".format(generator_id))
251251
return self._get(path)
252-
252+
253+
def receive_time(self, time_type):
254+
"""
255+
Returns the current time from the Adafruit IO Server
256+
:param string time_type: Type of time to be returned: `millis`, `seconds`, `ISO-8601`
257+
"""
258+
path = 'https://io.adafruit.com/api/v2/time/{0}'.format(time_type)
259+
return self._get(path)

0 commit comments

Comments
 (0)