diff --git a/sensor_simulation/clients/mqtt_client.py b/sensor_simulation/clients/mqtt_client.py index 58e48b5..b79b2ef 100644 --- a/sensor_simulation/clients/mqtt_client.py +++ b/sensor_simulation/clients/mqtt_client.py @@ -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, @@ -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