Skip to content

Clarify feed callback docstrings #47

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 2 commits into from
Nov 3, 2020
Merged
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
11 changes: 9 additions & 2 deletions adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,12 @@ def _on_unsubscribe_mqtt(self, client, user_data, topic, pid):
self.on_unsubscribe(self, user_data, topic, pid)

def add_feed_callback(self, feed_key, callback_method):
"""Executes callback_method whenever a message is
received on feed_key.
"""Attaches a callback_method to an Adafruit IO feed.
The callback_method function is called when a
new value is written to the feed.
NOTE: The callback_method registered to this method
will only execute during loop().
:param str feed_key: Adafruit IO feed key.
:param str callback_method: Name of callback method.
Expand All @@ -218,6 +222,9 @@ def add_feed_callback(self, feed_key, callback_method):
def remove_feed_callback(self, feed_key):
"""Removes a previously registered callback method
from executing whenever feed_key receives new data.
After this method is called, incoming messages
call the shared on_message.
:param str feed_key: Adafruit IO feed key.
"""
Expand Down