Skip to content

Commit 8391037

Browse files
committed
MQTT: Support username/password
Set in MSGFLO_BROKER url
1 parent 9f3b260 commit 8391037

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

msgflo/msgflo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ def __init__(self, broker):
200200
Engine.__init__(self, broker)
201201

202202
self._client = mqtt.Client()
203+
204+
if self.broker_info.username:
205+
self._client.username_pw_set(self.broker_info.username, self.broker_info.password)
206+
203207
self._client.on_connect = self._on_connect
204208
self._client.on_message = self._on_message
205209
self._client.on_subscribe = self._on_subscribe

0 commit comments

Comments
 (0)