Skip to content

Add push_to_io optional params to wrapper #50

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 1 commit into from
Sep 30, 2021
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions adafruit_portalbase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,17 @@ def get_local_time(self, location=None):
"""Accessor function for get_local_time()"""
return self.network.get_local_time(location=location)

def push_to_io(self, feed_key, data):
def push_to_io(self, feed_key, data, metadata=None, precision=None):
"""Push data to an adafruit.io feed

:param str feed_key: Name of feed key to push data to.
:param data: data to send to feed
:param dict metadata: Optional metadata associated with the data
:param int precision: Optional amount of precision points to send with floating point data

"""

self.network.push_to_io(feed_key, data)
self.network.push_to_io(feed_key, data, metadata=metadata, precision=precision)

def get_io_data(self, feed_key):
"""Return all values from the Adafruit IO Feed Data that matches the feed key
Expand Down