From 795871ed6a1fdb75622cd542c3295c62eb03334f Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 9 Jul 2021 14:06:51 -0400 Subject: [PATCH] Added access to metadata and precision arguments --- adafruit_portalbase/network.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/adafruit_portalbase/network.py b/adafruit_portalbase/network.py index e895dc5..9c4f7ec 100644 --- a/adafruit_portalbase/network.py +++ b/adafruit_portalbase/network.py @@ -362,11 +362,13 @@ def _get_io_client(self): self._io_client = IO_HTTP(aio_username, aio_key, self._wifi.requests) return self._io_client - 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 """ @@ -385,7 +387,7 @@ def push_to_io(self, feed_key, data): while True: try: - io_client.send_data(feed_id["key"], data) + io_client.send_data(feed_id["key"], data, metadata, precision) except RuntimeError as exception: print("An error occured, retrying! 2 -", exception) continue