Fix notifier MQTT subscriber
This commit is contained in:
1 parent
e6ccd8f1d7
commit
6248cba10d
1 file changed
+2
@@ -16,6 +16,8 @@ class MQTTSubscriber:
|
|||||||
self._client = MQTTClient()
|
self._client = MQTTClient()
|
||||||
if username and password:
|
if username and password:
|
||||||
self._client.username_pw_set(username, password=password)
|
self._client.username_pw_set(username, password=password)
|
||||||
|
self._client.on_connect = self._on_connect
|
||||||
|
self._client.on_message = self._on_message
|
||||||
|
|
||||||
def subscribe(self) -> None:
|
def subscribe(self) -> None:
|
||||||
self._client.connect(host=self._host, port=self._port)
|
self._client.connect(host=self._host, port=self._port)
|
||||||
|
|||||||
Reference in new issue
Block a user