Class MqttPlugin new
The class MqttPlugin implements the base class of all smart-plugins that use MQTT. The implemented methods are described below.
In addition the methods implemented in lib.utils.Utils are inherited.
Start subscription to all topics
Should be called from the run method of a plugin
Stop subscription to all topics
Should be called from the stop method of a plugin
add_subscription(topic, payload_type, bool_values=None, item=None, callback=None)
- topic – topic to subscribe to
- payload_type – payload type of the topic (for this subscription to the topic)
- bool_values – bool values (for this subscription to the topic)
- item – item that should receive the payload as value. Used by the standard handler (if no callback function is specified)
- callback – a plugin can provide an own callback function, if special handling of the payload is needed