Skip to content

Commit e8532e0

Browse files
committed
black
1 parent 0794d69 commit e8532e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/esp32spi/minimqtt_pub_sub_nonblocking_esp32spi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
def connected(client, userdata, flags, rc):
5858
# This function will be called when the client is connected
5959
# successfully to the broker.
60-
print("Connected to MQTT broker! Listening for topic changes on %s" % default_topic)
60+
print(f"Connected to MQTT broker! Listening for topic changes on {default_topic}")
6161
# Subscribe to all changes on the default_topic feed.
6262
client.subscribe(default_topic)
6363

@@ -73,7 +73,7 @@ def message(client, topic, message):
7373
:param str topic: The topic of the feed with a new value.
7474
:param str message: The new value
7575
"""
76-
print("New message on topic {0}: {1}".format(topic, message))
76+
print(f"New message on topic {topic}: {message}")
7777

7878

7979
# Connect to WiFi
@@ -103,7 +103,7 @@ def message(client, topic, message):
103103
mqtt_client.loop()
104104

105105
# Send a new message
106-
print("Sending photocell value: %d" % photocell_val)
106+
print(f"Sending photocell value: {photocell_val}")
107107
mqtt_client.publish(default_topic, photocell_val)
108108
photocell_val += 1
109109
time.sleep(0.5)

examples/native_networking/minimqtt_pub_sub_blocking_native_networking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
def connected(client, userdata, flags, rc):
3737
# This function will be called when the client is connected
3838
# successfully to the broker.
39-
print("Connected to MQTT broker! Listening for topic changes on %s" % default_topic)
39+
print(f"Connected to MQTT broker! Listening for topic changes on {default_topic}")
4040
# Subscribe to all changes on the default_topic feed.
4141
client.subscribe(default_topic)
4242

@@ -52,7 +52,7 @@ def message(client, topic, message):
5252
:param str topic: The topic of the feed with a new value.
5353
:param str message: The new value
5454
"""
55-
print("New message on topic {0}: {1}".format(topic, message))
55+
print(f"New message on topic {topic}: {message}")
5656

5757

5858
# Create a socket pool

0 commit comments

Comments
 (0)