wotpy.protocols.mqtt.server

Class that implements the MQTT server (broker).

Classes

MQTTServer(broker_url[, ...])

MQTT binding server implementation.

class wotpy.protocols.mqtt.server.MQTTServer(broker_url, property_callback_ms=None, event_callback_ms=None, ca_file=None, servient_id=None, username=None, password=None)

Bases: BaseProtocolServer

MQTT binding server implementation.

DEFAULT_SERVIENT_ID = 'wotpy'
build_base_url(hostname, thing)

Returns the base URL for the given Thing in the context of this server.

build_forms(hostname, interaction)

Builds and returns a list with all Forms that are linked to this server for the given Interaction.

property protocol

Protocol of this server instance. A member of the Protocols enum.

property servient_id

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

async start(servient=None)

Starts the MQTT broker and all the MQTT clients that handle the WoT clients requests.

async stop()

Stops the MQTT broker and the MQTT clients.