From 99f052e8b1f3a5614a2c7f2d397f797d76224667 Mon Sep 17 00:00:00 2001 From: jaydee Date: Sat, 8 Jun 2024 23:32:48 +0200 Subject: [PATCH] bitwarden --- playbooks/files/scripts/mqtt_srv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/files/scripts/mqtt_srv.py b/playbooks/files/scripts/mqtt_srv.py index 6479a1c..eab29ea 100644 --- a/playbooks/files/scripts/mqtt_srv.py +++ b/playbooks/files/scripts/mqtt_srv.py @@ -238,8 +238,11 @@ if _PUBLISH: print("Connected to MQTT Broker!") else: print("Failed to connect, return code %d\n", rc) + if paho.mqtt.__version__[0] > '1': + client = mqttClient.Client(mqttClient.CallbackAPIVersion.VERSION1) + else: + client = mqttClient.Client(client_id) - client = mqttClient.Client(client_id) client.username_pw_set(username, password) client.on_connect = on_connect client.connect(MQTT_HOST, MQTT_PORT)