From 8846af6a94ba374f766e986d2055cee05e647ce2 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 25 Jul 2018 12:08:49 +0000 Subject: [PATCH] Added send_location_data method to Adafruit IO plugin --- platypush/plugins/adafruit/io.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/platypush/plugins/adafruit/io.py b/platypush/plugins/adafruit/io.py index 065803392..7f13c43a6 100644 --- a/platypush/plugins/adafruit/io.py +++ b/platypush/plugins/adafruit/io.py @@ -144,6 +144,29 @@ class AdafruitIoPlugin(Plugin): redis.rpush(self._DATA_THROTTLER_QUEUE, {feed:value}) + @action + def send_location_data(self, feed, lat, lon, value=None): + """ + Send location data to an Adafruit IO feed + + :param feed: Feed name + :type feed: str + + :param lat: Latitude + :type lat: float + + :param lon: Longitude + :type lon: float + + :param value: (Optional) value to send + :type value: Numeric or string + + :param enqueue: If throttle_seconds is set, this method by default will append values to the throttling queue to be periodically flushed instead of sending the message directly. In such case, pass enqueue=False to override the behaviour and send the message directly instead. + :type enqueue: bool + """ + + self.aio.send_location_data(feed=feed, value=value, lat=lat, lon=lon) + @action def receive(self, feed): """