Skip to content

Commit 78243f1

Browse files
committed
Add topic argument to on_publish and Cleanup whitespace
1 parent 10d374a commit 78243f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

adafruit_io/adafruit_io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ def _on_message_mqtt(self, client, topic: str, payload: str):
204204
self.on_message(self, topic_name, message)
205205

206206
# pylint: disable=not-callable, unused-argument
207-
def _on_publish_mqtt(self, client, user_data, pid):
207+
def _on_publish_mqtt(self, client, user_data, topic, pid):
208208
"""Runs when the client calls on_publish."""
209209
if self.on_publish is not None:
210-
self.on_publish(self, user_data, pid)
210+
self.on_publish(self, user_data, topic, pid)
211211

212212
# pylint: disable=not-callable
213213
def _on_subscribe_mqtt(self, client, user_data, topic, qos):

examples/adafruit_io_mqtt/adafruit_io_simpletest_esp32s2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def publish(client, userdata, topic, pid):
7979
# This method is called when the client publishes data to a feed.
8080
print("Published to {0} with PID {1}".format(topic, pid))
8181
if userdata is not None:
82-
print("Published User data: ",end="")
82+
print("Published User data: ", end="")
8383
print(userdata)
8484

8585

0 commit comments

Comments
 (0)