Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new IP-based time endpoint #96

Merged
merged 3 commits into from
Mar 12, 2019
Merged

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