pull/8/head
Nico 2015-11-08 20:46:58 +01:00
rodzic d71b9c1483
commit 263d86f942
2 zmienionych plików z 12 dodań i 25 usunięć

Wyświetl plik

@ -1,4 +1,6 @@
MQTTClient API reference
========================
TBD
.. autoclass:: hbmqtt.client.MQTTClient
:members:
:undoc-members:

Wyświetl plik

@ -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 <https://github.com/mqtt/mqtt.github.io/wiki/URI-Scheme>`_.
:param cleansession: MQTT CONNECT clean session flaf
:param cafile: server certificate authority file