Skip to content

Commit 0cf46eb

Browse files
author
brentru
committed
Black example
1 parent 60d11b7 commit 0cf46eb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/adafruit_io_mqtt/adafruit_io_feed_callback.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def connected(client):
5555
# calls against it easily.
5656
print("Connected to Adafruit IO! Listening for DemoFeed changes...")
5757

58+
5859
def subscribe(client, userdata, topic, granted_qos):
5960
# This method is called when the client subscribes to a new feed.
6061
print("Subscribed to {0} with QOS level {1}".format(topic, granted_qos))
@@ -83,6 +84,7 @@ def on_battery_msg(client, topic, message):
8384
# Method called whenever user/feeds/battery has a new value
8485
print("Battery level: {}v".format(message))
8586

87+
8688
# Connect to WiFi
8789
print("Connecting to WiFi...")
8890
wifi.connect()
@@ -93,7 +95,9 @@ def on_battery_msg(client, topic, message):
9395

9496
# Initialize a new MQTT Client object
9597
mqtt_client = MQTT.MQTT(
96-
broker="io.adafruit.com", username=secrets["aio_username"], password=secrets["aio_key"],
98+
broker="io.adafruit.com",
99+
username=secrets["aio_username"],
100+
password=secrets["aio_key"],
97101
)
98102

99103
# Initialize an Adafruit IO MQTT Client

0 commit comments

Comments
 (0)