Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sensor_simulation/clients/mqtt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class MqttClient:
def __init__(self,
broker_address: str,
port: int = 1883,
username: str = None,
password: str = None,
keepalive: int = 60,
bind_address: str = "",
bind_port: int = 0,
Expand All @@ -28,6 +30,7 @@ def __init__(self,
:param bind_port: Bind port
"""
self.client = mqtt.Client(client_id=client_id)
self.client.username_pw_set(username, password)
self.broker_address = broker_address
self.port = port
self.keepalive = keepalive
Expand Down