-
Notifications
You must be signed in to change notification settings - Fork 31
Add feed callback mechanism #46
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
Conversation
|
||
""" | ||
self._client.remove_topic_callback("{0}/feeds/{1}".format(self._user, feed_key)) | ||
|
||
def loop(self): | ||
"""Manually process messages from Adafruit IO. | ||
Call this method to check incoming subscription messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a sentence here about how it will call the event handlers depending on the type of message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressing this here: #47
if self._logger: | ||
self._client._logger.debug("Client called on_unsubscribe") | ||
if self.on_unsubscribe is not None: | ||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please mention here that the method is called by loop
.
Updating https://github.com/adafruit/Adafruit_CircuitPython_FRAM to 1.3.4 from 1.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_FRAM#22 from caternuson/iss12 Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 4.2.0 from 4.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#46 from brentru/add-callback-feed
Addresses #45
Tested on
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit PyPortal with samd51j20
Test is the example modified to include
remove_callback
Expected behavior - should not fire a second time since it's removed
Behavior: