Remove debug statements
This commit is contained in:
@@ -46,7 +46,6 @@ class MQTTService:
|
|||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
if not self._connected:
|
if not self._connected:
|
||||||
print(f"Connecting to {self.address}...")
|
|
||||||
self.client.connect(self.address, self.port)
|
self.client.connect(self.address, self.port)
|
||||||
self.client.loop_start()
|
self.client.loop_start()
|
||||||
timeout = 5
|
timeout = 5
|
||||||
@@ -56,8 +55,6 @@ class MQTTService:
|
|||||||
if not self._connected:
|
if not self._connected:
|
||||||
raise ConnectionError(f"Cannot connect to MQTT broker at {self.address}:{self.port}")
|
raise ConnectionError(f"Cannot connect to MQTT broker at {self.address}:{self.port}")
|
||||||
print(f"Successfully connected to {self.address}")
|
print(f"Successfully connected to {self.address}")
|
||||||
else :
|
|
||||||
print(f"Already connected to {self.address}...")
|
|
||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
if self._connected:
|
if self._connected:
|
||||||
@@ -84,7 +81,6 @@ class MQTTService:
|
|||||||
self._subscriptions[topic] = handler
|
self._subscriptions[topic] = handler
|
||||||
|
|
||||||
def on_message(client, userdata, msg):
|
def on_message(client, userdata, msg):
|
||||||
print(f"Received {msg.payload} on {msg.topic} from {client}")
|
|
||||||
for sub_topic, h in self._subscriptions.items():
|
for sub_topic, h in self._subscriptions.items():
|
||||||
if mqtt.topic_matches_sub(sub_topic, msg.topic):
|
if mqtt.topic_matches_sub(sub_topic, msg.topic):
|
||||||
h(msg.topic, msg.payload.decode())
|
h(msg.topic, msg.payload.decode())
|
||||||
|
|||||||
Reference in New Issue
Block a user