Skip to content

Commit 268210e

Browse files
brentrubrentru
authored andcommitted
fix docstring
1 parent 0587b66 commit 268210e

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

adafruit_minimqtt.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,20 @@ class MMQTTException(Exception):
8181
#pass
8282

8383
class MQTT:
84-
"""
85-
MQTT client interface for CircuitPython devices.
86-
:param socket: Socket object for provided network interface
87-
:param str broker: MQTT Broker URL or IP Address.
88-
:param int port: Optional port definition, defaults to 8883.
89-
:param str username: Username for broker authentication.
90-
:param str password: Password for broker authentication.
91-
:param ESP_SPIcontrol esp: An ESP network interface object.
92-
:param str client_id: Optional client identifier, defaults to a unique, generated string.
93-
:param bool is_ssl: Sets a secure or insecure connection with the broker.
94-
Defaults to True (port 8883).
95-
:param bool log: Attaches a logger to the MQTT client, defaults to logging level INFO.
96-
"""
97-
# pylint: disable=too-many-arguments,too-many-instance-attributes, not-callable, invalid-name
84+
# pylint: disable=too-many-arguments,too-many-instance-attributes, not-callable, invalid-name, no-member
9885
def __init__(self, socket, broker, port=None, username=None,
9986
password=None, esp=None, client_id=None, is_ssl=True, log=False):
87+
"""Initializes a MQTT client object.
88+
:param socket: Socket object for provided network interface
89+
:param str broker: MQTT Broker URL or IP Address.
90+
:param int port: Optional port definition, defaults to 8883.
91+
:param str username: Username for broker authentication.
92+
:param str password: Password for broker authentication.
93+
:param ESP_SPIcontrol esp: An ESP network interface object.
94+
:param str client_id: Optional client identifier, defaults to a unique, generated string.
95+
:param bool is_ssl: Sets a secure or insecure connection with the broker.
96+
:param bool log: Attaches a logger to the MQTT client, defaults to logging level INFO.
97+
"""
10098
# network interface
10199
self._socket = socket
102100
if esp is not None:
@@ -129,7 +127,6 @@ def __init__(self, socket, broker, port=None, username=None,
129127
self._client_id = client_id
130128
else:
131129
# assign a unique client_id
132-
# pylint: disable=no-member
133130
self._client_id = 'cpy{0}{1}'.format(microcontroller.cpu.uid[randint(0, 15)],
134131
randint(0, 9))
135132
# generated client_id's enforce spec.'s length rules

0 commit comments

Comments
 (0)