added log output

blueprint_refactoring
Simon Pirkelmann 2022-09-12 22:21:56 +02:00
parent d53334efd4
commit 19d330b6d8
1 changed files with 1 additions and 5 deletions

View File

@ -40,12 +40,10 @@ class DoorHandle:
self.mqtt_client.on_message = self.on_message
self.mqtt_client.connect_async(host=mqtt_host, port=mqtt_port)
self.mqtt_client.loop_start()
self.logger.info(f"Connected to MQTT broker at {mqtt_host}:{mqtt_port}")
self.data_fields = ['name', 'organization', 'email', 'valid_thru']
pass
# The callback for when the client receives a CONNACK response from the server.
def on_connect(self, client, userdata, flags, rc):
self.logger.info("Connected to MQTT broker with result code " + str(rc))
@ -54,8 +52,6 @@ class DoorHandle:
# reconnect then subscriptions will be renewed.
client.subscribe("door/#")
pass
# The callback for when a PUBLISH message is received from the server.
def on_message(self, client, userdata, msg):
#print(msg.topic + " " + str(msg.payload))