Skip to content

Commit 8404f9a

Browse files
authored
Merge pull request #87 from brentru/add-mqtt-get
Add MQTT Receive to Client
2 parents 35846bd + c3cdd7b commit 8404f9a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Adafruit_IO/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.1"
1+
__version__ = "2.1.1"

Adafruit_IO/mqtt_client.py

+9
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ def unsubscribe(self, feed_id=None, group_id=None):
256256
raise TypeError('Invalid topic type specified.')
257257
return
258258

259+
def receive(self, feed_id):
260+
"""Receive the last published value from a specified feed.
261+
262+
:param string feed_id: The ID of the feed to update.
263+
:parm string value: The new value to publish to the feed
264+
"""
265+
(res, self._pub_mid) = self._client.publish('{0}/feeds/{1}/get'.format(self._username, feed_id),
266+
payload='')
267+
259268
def publish(self, feed_id, value=None, group_id=None, feed_user=None):
260269
"""Publish a value to a specified feed.
261270

0 commit comments

Comments
 (0)