added log output
This commit is contained in:
parent
d53334efd4
commit
19d330b6d8
|
@ -40,12 +40,10 @@ class DoorHandle:
|
||||||
self.mqtt_client.on_message = self.on_message
|
self.mqtt_client.on_message = self.on_message
|
||||||
self.mqtt_client.connect_async(host=mqtt_host, port=mqtt_port)
|
self.mqtt_client.connect_async(host=mqtt_host, port=mqtt_port)
|
||||||
self.mqtt_client.loop_start()
|
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']
|
self.data_fields = ['name', 'organization', 'email', 'valid_thru']
|
||||||
|
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
# The callback for when the client receives a CONNACK response from the server.
|
# The callback for when the client receives a CONNACK response from the server.
|
||||||
def on_connect(self, client, userdata, flags, rc):
|
def on_connect(self, client, userdata, flags, rc):
|
||||||
self.logger.info("Connected to MQTT broker with result code " + str(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.
|
# reconnect then subscriptions will be renewed.
|
||||||
client.subscribe("door/#")
|
client.subscribe("door/#")
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
# The callback for when a PUBLISH message is received from the server.
|
# The callback for when a PUBLISH message is received from the server.
|
||||||
def on_message(self, client, userdata, msg):
|
def on_message(self, client, userdata, msg):
|
||||||
#print(msg.topic + " " + str(msg.payload))
|
#print(msg.topic + " " + str(msg.payload))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user