This commit is contained in:
Robert Borzutzki 2022-10-19 09:10:45 +02:00
parent 4b03a77e7d
commit 50782d9948

View File

@ -30,7 +30,8 @@ def on_connect(client, userdata, flags, rc):
print("Failed to connect, return code %d\n", rc) print("Failed to connect, return code %d\n", rc)
def on_message(client, userdata, msg): def on_message(client, userdata, msg):
print(f"Received `{msg.payload.decode()}` from `{msg.topic}` topic") print(f"`{msg.topic}`: `{msg.payload.decode()}`")
print("-----")
Connected = False #global variable for the state of the connection Connected = False #global variable for the state of the connection