diff --git a/docs/references/mqttclient.rst b/docs/references/mqttclient.rst index 3626b10..e4fed06 100644 --- a/docs/references/mqttclient.rst +++ b/docs/references/mqttclient.rst @@ -1,4 +1,6 @@ MQTTClient API reference ======================== -TBD \ No newline at end of file +.. autoclass:: hbmqtt.client.MQTTClient + :members: + :undoc-members: \ No newline at end of file diff --git a/hbmqtt/client.py b/hbmqtt/client.py index 6cbf9e1..4ab2ee0 100644 --- a/hbmqtt/client.py +++ b/hbmqtt/client.py @@ -72,31 +72,15 @@ def mqtt_connected(func): class MQTTClient: - def __init__(self, client_id=None, config=None, loop=None): - """ + """ + MQTT client implementation. Create ``MQTTClient`` instances to connect to a broker and send/receive messages using the MQTT protocol - :param config: Example yaml config - broker: - uri: mqtt:username@password//localhost:1883/ - cafile: somefile.cert #Server authority file - capath: /some/path # certficate file path - cadata: certificate as string data - keep_alive: 60 - cleansession: true - will: - retain: false - topic: some/topic - message: Will message - qos: 0 - default_qos: 0 - default_retain: false - topics: - a/b: - qos: 2 - retain: true - :param loop: - :return: - """ + :param client_id: MWTT client ID to use when connecting to the broker. If none, it will generated randomly + :param config: Client configuration + :param loop: asynio loop to use + :return: + """ + def __init__(self, client_id=None, config=None, loop=None): self.logger = logging.getLogger(__name__) self.config = _defaults if config is not None: @@ -133,6 +117,7 @@ class MQTTClient: cadata=None): """ Connect to a remote broker + :param uri: Broker URI connection, conforming to `MQTT URI scheme `_. :param cleansession: MQTT CONNECT clean session flaf :param cafile: server certificate authority file