Skip to content

Commit 93c55af

Browse files
author
brentru
committed
lint
1 parent 629ecb0 commit 93c55af

1 file changed

Lines changed: 1 addition & 47 deletions

File tree

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@
8181
_the_interface = None # pylint: disable=invalid-name
8282
_the_sock = None # pylint: disable=invalid-name
8383

84-
8584
class MMQTTException(Exception):
8685
"""MiniMQTT Exception class."""
8786

8887
# pylint: disable=unnecessary-pass
8988
# pass
9089

91-
9290
# Legacy ESP32SPI Socket API
9391
def set_socket(sock, iface=None):
9492
"""Legacy API for setting the socket and network interface, use a `Session` instead.
@@ -572,33 +570,13 @@ def ping(self):
572570
# pylint: disable=too-many-branches, too-many-statements
573571
def publish(self, topic, msg, retain=False, qos=0):
574572
"""Publishes a message to a topic provided.
575-
576573
:param str topic: Unique topic identifier.
577574
:param str,int,float msg: Data to send to the broker.
578575
:param bool retain: Whether the message is saved by the broker.
579576
:param int qos: Quality of Service level for the message, defaults to
580577
zero. Conventional options are ``0`` (send at most once), ``1``
581578
(send at least once), or ``2`` (send exactly once).
582579
583-
.. note:: Only options ``1`` or ``0`` are QoS levels supported by this library.
584-
585-
Example of sending an integer, 3, to the broker on topic 'piVal'.
586-
587-
.. code-block:: python
588-
589-
mqtt_client.publish('topics/piVal', 3)
590-
591-
Example of sending a float, 3.14, to the broker on topic 'piVal'.
592-
593-
.. code-block:: python
594-
595-
mqtt_client.publish('topics/piVal', 3.14)
596-
597-
Example of sending a string, 'threepointonefour', to the broker on topic piVal.
598-
599-
.. code-block:: python
600-
601-
mqtt_client.publish('topics/piVal', 'threepointonefour')
602580
"""
603581
self.is_connected()
604582
self._valid_topic(topic)
@@ -687,30 +665,6 @@ def subscribe(self, topic, qos=0):
687665
688666
.. note:: Only options ``1`` or ``0`` are QoS levels supported by this library.
689667
690-
Example of subscribing a topic string.
691-
692-
.. code-block:: python
693-
694-
mqtt_client.subscribe('topics/ledState')
695-
696-
Example of subscribing to a topic and setting the qos level to 1.
697-
698-
.. code-block:: python
699-
700-
mqtt_client.subscribe('topics/ledState', 1)
701-
702-
Example of subscribing to topic string and setting qos level to 1, as a tuple.
703-
704-
.. code-block:: python
705-
706-
mqtt_client.subscribe(('topics/ledState', 1))
707-
708-
Example of subscribing to multiple topics with different qos levels.
709-
710-
.. code-block:: python
711-
712-
mqtt_client.subscribe([('topics/ledState', 1), ('topics/servoAngle', 0)])
713-
714668
"""
715669
self.is_connected()
716670
topics = None
@@ -882,7 +836,7 @@ def _wait_for_msg(self, timeout=0.1):
882836
if error.errno == errno.ETIMEDOUT:
883837
# raised by a socket timeout in socketpool
884838
return None
885-
raise MMQTTException(error)
839+
raise MMQTTException from error
886840

887841
# Block while we parse the rest of the response
888842
self._sock.settimeout(timeout)

0 commit comments

Comments
 (0)