adafruit.io
Platypush documentation
adafruit.io
- class platypush.backend.adafruit.io.AdafruitIoBackend(feeds, *args, **kwargs)[source]
Bases:
Backend
Backend that listens to messages received over the Adafruit IO message queue
Triggers:
platypush.message.event.adafruit.ConnectedEvent
when thebackend connects to the Adafruit queue
platypush.message.event.adafruit.DisconnectedEvent
when thebackend disconnects from the Adafruit queue
platypush.message.event.adafruit.FeedUpdateEvent
when anupdate event is received on a monitored feed
Requires:
- The
platypush.plugins.adafruit.io.AdafruitIoPlugin
plugin to be active and configured.
- The
- on_message(*_, **__)[source]
Callback when a message is received on the backend. It parses and posts the message on the main bus. It should be called by the derived classes whenever a new message should be processed.
- Parameters:
msg – Received message. It can be either a key-value dictionary, a platypush.message.Message object, or a string/byte UTF-8 encoded string