wotpy.protocols.mqtt.handlers.base

Base class for all MQTT handlers.

Classes

BaseMQTTHandler(mqtt_server)

Base class for all MQTT handlers.

class wotpy.protocols.mqtt.handlers.base.BaseMQTTHandler(mqtt_server)

Bases: object

Base class for all MQTT handlers.

async handle_message(msg)

Called each time the runner receives a message for one of the handler topics.

async init()

Initializes the MQTT handler. Called when the MQTT runner starts.

property mqtt_server

MQTT server that contains this handler.

property queue

Asynchronous queue where the handler leaves messages that should be published later by the runner.

property servient_id

Servient ID that is used to avoid topic collisions when multiple Servients are connected to the same broker.

async teardown()

Destroys the MQTT handler. Called when the MQTT runner stops.

property topics

List of topics that this MQTT handler wants to subscribe to.