Add some debug logging
This commit is contained in:
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user