diff --git a/Adafruit_IO/errors.py b/Adafruit_IO/errors.py index 52e1590..52b3fd7 100644 --- a/Adafruit_IO/errors.py +++ b/Adafruit_IO/errors.py @@ -22,16 +22,6 @@ import json, requests from paho.mqtt.client import error_string -# MQTT RC Error Types *** OBSOLETE *** -# See error_string() in client.py and enums.py from paho instead -# https://github.com/eclipse/paho.mqtt.python/blob/4eeb431f5ae72b42474cec42641fca1daa91c4b0/src/paho/mqtt/client.py#L291-L404 -MQTT_ERRORS = [ 'Connection successful', - 'Incorrect protocol version', - 'Invalid Client ID', - 'Server unavailable ', - 'Bad username or password', - 'Not authorized' ] - class AdafruitIOError(Exception): """Base class for all Adafruit IO request failures.""" pass diff --git a/Adafruit_IO/mqtt_client.py b/Adafruit_IO/mqtt_client.py index 4a16b20..198b4d6 100644 --- a/Adafruit_IO/mqtt_client.py +++ b/Adafruit_IO/mqtt_client.py @@ -59,7 +59,7 @@ def __init__(self, username, key, service_host='io.adafruit.com', secure=True): self.on_disconnect = None self.on_message = None self.on_subscribe = None - # Initialize MQTT client. + # Initialize v1 MQTT client. self._client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1) if secure: self._client.tls_set_context() diff --git a/examples/mqtt/mqtt_viewall.py b/examples/mqtt/mqtt_viewall.py index 36c2250..31c3a9e 100644 --- a/examples/mqtt/mqtt_viewall.py +++ b/examples/mqtt/mqtt_viewall.py @@ -54,7 +54,7 @@ def on_message(client, userdata, msg): print('Received on {0}: {1}'.format(msg.topic, msg.payload.decode('utf-8'))) -# Create MQTT client and connect to Adafruit IO. +# Create Paho v1 MQTT client and connect to Adafruit IO. client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1) client.username_pw_set(USERNAME, KEY) client.on_connect = on_connect