Skip to content

Commit c3cdd7b

Browse files
author
brentru
committed
add mqtt get to client, bump version
1 parent 35846bd commit c3cdd7b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Adafruit_IO/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.1"
1+
__version__ = "2.1.1"

Adafruit_IO/mqtt_client.py

Lines changed: 9 additions & 0 deletions
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)