:py:mod:`expliot.plugins.mqtt.mqttsub` ====================================== .. py:module:: expliot.plugins.mqtt.mqttsub .. autoapi-nested-parse:: Plugin to subscribe to a topic of a MQTT broker. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: expliot.plugins.mqtt.mqttsub.MqttSub .. py:class:: MqttSub Bases: :py:obj:`expliot.core.tests.test.Test` Subscribe to a topic of a MQTT broker. Output Format: [ { "topic": "foobar/topic", "payload": "Foobar payload" }, # ... May be zero or more entries ] .. py:method:: on_msg(client, userdata, message) Custom on_message callback for MqttClient. It just logs the topic and the message received. Args: client (MqttClient) - The MQTT client object. This is not used. userdata (caller defined): Callback specific data passed in __init__() of MqttClient. This is not used as we cane use self members to pass information. message (MQTTMessage): Contains topic, payload, qos, retain for the message received from the broker. Returns: Nothing. .. py:method:: execute() Execute the plugin.