class MQTTHandler(object):
Known subclasses: acme.plugins.bindings.MQTTClient.MQTTClientHandler
This base class defines the interface for an MQTT handler class. The abstract methods defined here must be implemented by the implementing class.
The implementing class acts as a handler for various callbacks when dealing with
the MQTT handler. To receive messages a client implementation must register topics
and the callbacks for them in the onConnect() method.
| Method | logging |
This method is called when a log message should be handled. |
| Method | on |
This method is called after the MQTT client connected to the MQTT broker. Usually, an MQTT client should subscribe to topics and register the callback methods here. |
| Method | on |
This method is called after the MQTT client disconnected from the MQTT broker. |
| Method | on |
This method is called when receiving an error when communicating with the MQTT broker. |
| Method | on |
This method is called after the `connection` was shut down. |
| Method | on |
This method is called after the MQTT client successfully subsribed to a topic. |
| Method | on |
This method is called after the MQTT client successfully unsubsribed from a topic. |
acme.plugins.bindings.MQTTClient.MQTTClientHandlerThis method is called when a log message should be handled.
| Parameters | |
connection:MQTTConnection | None | The MQTT connection. |
level:int | The log level. |
message:str | The log message. |
| Returns | |
bool | True if successful, False otherwise. |
acme.plugins.bindings.MQTTClient.MQTTClientHandlerThis method is called after the MQTT client connected to the MQTT broker. Usually, an MQTT client should subscribe to topics and register the callback methods here.
| Parameters | |
connection:MQTTConnection | The MQTT connection. |
| Returns | |
bool | True if successful, False otherwise. |
acme.plugins.bindings.MQTTClient.MQTTClientHandlerThis method is called after the MQTT client disconnected from the MQTT broker.
| Parameters | |
connection:MQTTConnection | The MQTT connection. |
| Returns | |
bool | True if successful, False otherwise. |
acme.plugins.bindings.MQTTClient.MQTTClientHandlerThis method is called when receiving an error when communicating with the MQTT broker.
| Parameters | |
connection:MQTTConnection | The MQTT connection. |
rc:int | The error code. |
| Returns | |
bool | True if successful, False otherwise. |
This method is called after the `connection` was shut down.
| Parameters | |
connection:MQTTConnection | The MQTT connection. |
acme.plugins.bindings.MQTTClient.MQTTClientHandlerThis method is called after the MQTT client successfully subsribed to a topic.
| Parameters | |
connection:MQTTConnection | The MQTT connection. |
topic:str | The topic that was subscribed to. |
| Returns | |
bool | True if successful, False otherwise. |
acme.plugins.bindings.MQTTClient.MQTTClientHandlerThis method is called after the MQTT client successfully unsubsribed from a topic.
| Parameters | |
connection:MQTTConnection | The MQTT connection. |
topic:str | The topic that was unsubscribed from. |
| Returns | |
bool | True if successful, False otherwise. |