Skip to content

Conversation

brentru
Copy link
Member

@brentru brentru commented Mar 12, 2019

This PR modifies the receive_time method to support the new time endpoint on Adafruit IO: /integrations/time/struct.json. This endpoint will return a time based on the IP Address. the time_topics.py example has been renamed time.py to reflect the removal of time-topics in the newest endpoint.

The new receive_time uses the new endpoint and returns the time as a struct_time(https://docs.python.org/3.7/library/time.html#time.struct_time). It also removes the kwarg time from receive_time - previously used to return the requested time type (sec/ms/iso) from Adafruit IO's endpoint.

The previous /time endpoint returned a plaintext response, instead of json. Since the new endpoint returns a JSON response, this PR will remove all plaintext-handling from the library used for the old /time endpoint:

  • Remove is_time from compose_url()
  • Remove is_time from _get()
  • Removal of is_time from compose_url()

@brentru brentru merged commit 869cf35 into adafruit:master Mar 12, 2019
@brentru brentru deleted the new-time-endpoint branch March 12, 2019 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant