Rework some stuff

This commit is contained in:
2025-12-30 04:08:06 +01:00
parent ceea55e4ce
commit b98778b466
3 changed files with 50 additions and 44 deletions

View File

@@ -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())