adafruit / Adafruit_IO_Python

Adafruit IO Python Client Library
Other
225 stars 99 forks source link

MQTT/REST Time Helpers #54

Closed brentru closed 6 years ago

brentru commented 6 years ago

https://github.com/adafruit/io-client-python/issues/53

Add ability to subscribe to time topics

time/millis time/seconds time/ISO-8601

API Client (client.py)

MQTT Client (mqtt_client.py)

brentru commented 6 years ago

Testing.... REST API python3 examples/aio_basics/adafruitio_17_time.py

---Adafruit IO REST API Time Helpers--- Seconds: aio.receive_time(seconds) 1530906256 Milliseconds: aio.receive_time(millis) 1530906256724 ISO-8601: aio.receive_time(ISO-8601) 2018-07-06T19:44:16+00:00

MQTT API python3 examples/mqtt/mqtt_time.py

  • Subscribing to /time/seconds Connected to Adafruit IO! Feed time received new value: 1530906374 Feed time received new value: 1530906375
  • Subscribing to /time/millis Feed time received new value: 1530906375990 Feed time received new value: 1530906376 Feed time received new value: 1530906376990 Feed time received new value: 1530906377
  • Subscribing to iso-8601 Feed time received new value: 2018-07-06T19:46:17.990Z Feed time received new value: 1530906377990 Feed time received new value: 1530906378 Feed time received new value: 2018-07-06T19:46:18.990Z Feed time received new value: 1530906378990 Feed time received new value: 1530906379

Merging in!