kopia lustrzana https://github.com/Yakifo/amqtt
Docstring
rodzic
d71b9c1483
commit
263d86f942
|
@ -1,4 +1,6 @@
|
||||||
MQTTClient API reference
|
MQTTClient API reference
|
||||||
========================
|
========================
|
||||||
|
|
||||||
TBD
|
.. autoclass:: hbmqtt.client.MQTTClient
|
||||||
|
:members:
|
||||||
|
:undoc-members:
|
|
@ -72,31 +72,15 @@ def mqtt_connected(func):
|
||||||
|
|
||||||
|
|
||||||
class MQTTClient:
|
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
|
:param client_id: MWTT client ID to use when connecting to the broker. If none, it will generated randomly
|
||||||
broker:
|
:param config: Client configuration
|
||||||
uri: mqtt:username@password//localhost:1883/
|
:param loop: asynio loop to use
|
||||||
cafile: somefile.cert #Server authority file
|
:return:
|
||||||
capath: /some/path # certficate file path
|
"""
|
||||||
cadata: certificate as string data
|
def __init__(self, client_id=None, config=None, loop=None):
|
||||||
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:
|
|
||||||
"""
|
|
||||||
self.logger = logging.getLogger(__name__)
|
self.logger = logging.getLogger(__name__)
|
||||||
self.config = _defaults
|
self.config = _defaults
|
||||||
if config is not None:
|
if config is not None:
|
||||||
|
@ -133,6 +117,7 @@ class MQTTClient:
|
||||||
cadata=None):
|
cadata=None):
|
||||||
"""
|
"""
|
||||||
Connect to a remote broker
|
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 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 cleansession: MQTT CONNECT clean session flaf
|
||||||
:param cafile: server certificate authority file
|
:param cafile: server certificate authority file
|
||||||
|
|
Ładowanie…
Reference in New Issue