diff options
Diffstat (limited to 'src/home/mqtt/_wrapper.py')
-rw-r--r-- | src/home/mqtt/_wrapper.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/home/mqtt/_wrapper.py b/src/home/mqtt/_wrapper.py index 41f9d89..0b32197 100644 --- a/src/home/mqtt/_wrapper.py +++ b/src/home/mqtt/_wrapper.py @@ -9,11 +9,15 @@ from ..util import strgen class MqttWrapper(Mqtt): _nodes: list[MqttNode] - def __init__(self, topic_prefix='hk', randomize_client_id=False): + def __init__(self, + topic_prefix='hk', + randomize_client_id=False, + clean_session=True): client_id = config['mqtt']['client_id'] if randomize_client_id: client_id += '_'+strgen(6) - super().__init__(clean_session=True, client_id=client_id) + super().__init__(clean_session=clean_session, + client_id=client_id) self._nodes = [] self._topic_prefix = topic_prefix |