Skip to content

Add push io #2

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

Merged
merged 3 commits into from
May 31, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added exception catching to network related function calls to account…
… for occasional timeout from the esp chip
  • Loading branch information
jasonlshelton committed May 1, 2019
commit a748fb036aaff6ac8fe5e24e48d29ab3a872dec5
7 changes: 6 additions & 1 deletion adafruit_pyportal.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,13 @@ def io_push(self, feed, data):
except AdafruitIO_RequestError:
# If no feed exists, create one
feed_id = io_connect.create_new_feed(feed)
except RuntimeError as exception:
print("Some error occured, retrying! -", exception)

io_connect.send_data(feed_id['key'], data)
try:
io_connect.send_data(feed_id['key'], data)
except RuntimeError as exception:
print("Some error occured, retrying! -", exception)

def fetch(self, refresh_url=None):
"""Fetch data from the url we initialized with, perfom any parsing,
Expand Down