Skip to content

Commit 2737781

Browse files
committed
PR Feedback: label client v1, clarify paho client in example/viewall
1 parent a0cb9f6 commit 2737781

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

Adafruit_IO/errors.py

-10
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@
2222
import json, requests
2323
from paho.mqtt.client import error_string
2424

25-
# MQTT RC Error Types *** OBSOLETE ***
26-
# See error_string() in client.py and enums.py from paho instead
27-
# https://github.com/eclipse/paho.mqtt.python/blob/4eeb431f5ae72b42474cec42641fca1daa91c4b0/src/paho/mqtt/client.py#L291-L404
28-
MQTT_ERRORS = [ 'Connection successful',
29-
'Incorrect protocol version',
30-
'Invalid Client ID',
31-
'Server unavailable ',
32-
'Bad username or password',
33-
'Not authorized' ]
34-
3525
class AdafruitIOError(Exception):
3626
"""Base class for all Adafruit IO request failures."""
3727
pass

Adafruit_IO/mqtt_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, username, key, service_host='io.adafruit.com', secure=True):
5959
self.on_disconnect = None
6060
self.on_message = None
6161
self.on_subscribe = None
62-
# Initialize MQTT client.
62+
# Initialize v1 MQTT client.
6363
self._client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)
6464
if secure:
6565
self._client.tls_set_context()

examples/mqtt/mqtt_viewall.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def on_message(client, userdata, msg):
5454
print('Received on {0}: {1}'.format(msg.topic, msg.payload.decode('utf-8')))
5555

5656

57-
# Create MQTT client and connect to Adafruit IO.
57+
# Create Paho v1 MQTT client and connect to Adafruit IO.
5858
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)
5959
client.username_pw_set(USERNAME, KEY)
6060
client.on_connect = on_connect

0 commit comments

Comments
 (0)