Rework some stuff
This commit is contained in:
@@ -83,6 +83,7 @@ class MQTTService:
|
||||
self._subscriptions[topic] = handler
|
||||
|
||||
def on_message(client, userdata, msg):
|
||||
print(f"Received {msg.payload} on {msg.topic} from {client}")
|
||||
for sub_topic, h in self._subscriptions.items():
|
||||
if mqtt.topic_matches_sub(sub_topic, msg.topic):
|
||||
h(msg.topic, msg.payload.decode())
|
||||
|
||||
Reference in New Issue
Block a user