Skip to content

Commit 77ef090

Browse files
committed
Update MQTT example to use new username field.
1 parent 8fd72c2 commit 77ef090

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/mqtt_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
# Set to your Adafruit IO key.
1414
ADAFRUIT_IO_KEY = 'YOUR ADAFRUIT IO KEY'
15+
ADAFRUIT_IO_USERNAME = 'YOUR ADAFRUIT IO USERNAME' # See https://accounts.adafruit.com
16+
# to find your username.
1517

1618

1719
# Define callback functions which will be called when certain events happen.
@@ -37,7 +39,7 @@ def message(client, feed_id, payload):
3739

3840

3941
# Create an MQTT client instance.
40-
client = MQTTClient(ADAFRUIT_IO_KEY)
42+
client = MQTTClient(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
4143

4244
# Setup the callback functions defined above.
4345
client.on_connect = connected

0 commit comments

Comments
 (0)