Fix mqtt prefix handling on thermostat worker (#30)
This commit is contained in:
@@ -59,6 +59,8 @@ class MqttClient:
|
||||
self.mqttc.connect(self.hostname, port=self.port)
|
||||
|
||||
for topic, callback in callbacks:
|
||||
if self.topic_prefix is not None:
|
||||
topic = "{}/{}".format(self.topic_prefix, topic)
|
||||
self.mqttc.message_callback_add(topic, callback)
|
||||
self.mqttc.subscribe(topic)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user