Skip to content

Add MQTT Receive to Client #87

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
Feb 12, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Adafruit_IO/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1"
__version__ = "2.1.1"
9 changes: 9 additions & 0 deletions Adafruit_IO/mqtt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ def unsubscribe(self, feed_id=None, group_id=None):
raise TypeError('Invalid topic type specified.')
return

def receive(self, feed_id):
"""Receive the last published value from a specified feed.

:param string feed_id: The ID of the feed to update.
:parm string value: The new value to publish to the feed
"""
(res, self._pub_mid) = self._client.publish('{0}/feeds/{1}/get'.format(self._username, feed_id),
payload='')

def publish(self, feed_id, value=None, group_id=None, feed_user=None):
"""Publish a value to a specified feed.

Expand Down