global topic_prefix fix try 2

This commit is contained in:
unconfigured
2018-12-20 12:33:29 +01:00
parent fabc48784b
commit f9f95a756b
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -5,7 +5,9 @@ class MqttClient:
def __init__(self, config):
self._config = config
self._mqttc = mqtt.Client(client_id=self.client_id, clean_session=False)
self._mqttc = mqtt.Client(client_id=self.client_id,
clean_session=False,
userdata = {'global_topic_prefix': self.topic_prefix})
if self.username and self.password:
self.mqttc.username_pw_set(self.username, self.password)