Add some debug logging

This commit is contained in:
2025-12-30 04:17:09 +01:00
parent c277789626
commit 47e0661fa9

View File

@@ -67,6 +67,7 @@ class MQTTService:
def publish(self, topic: str, data: str, qos: int = 0):
try:
print("Trying to publish...")
self.connect()
payload = {
"timestamp": int(time.time()),
@@ -90,6 +91,7 @@ class MQTTService:
self.client.on_message = on_message
self.client.subscribe(topic, qos=qos)
print("Subscribed to " + topic)
except Exception as e:
print(f"An error occurred while trying to subscribe to {topic} on {self.address} : {e}")