From 3c055ecf5615868d8ce9be932cddbcf59020fbab Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 16 May 2024 22:56:08 -0400 Subject: mqtt-notify.py: Make compatible with paho-mqtt v2 --- mqtt-notify.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mqtt-notify.py b/mqtt-notify.py index 96ad556..287427f 100755 --- a/mqtt-notify.py +++ b/mqtt-notify.py @@ -41,7 +41,7 @@ class Signaler: self.loop.quit() -def on_connect(client, userdata, flags, rc): +def on_connect(client, userdata, flags, reason_code, properties): print("Connected") # Subscribing in on_connect() means that if we lose the connection and @@ -98,7 +98,7 @@ def on_message(client, userdata, msg): sys.exit(-1) -def on_disconnect(client, userdata, rc): +def on_disconnect(client, userdata, flags, reason_code, properties): print("Disconnected") @@ -164,7 +164,7 @@ def main(argv): user, broker, port, topic = config(args.config.name) Notify.init("MQTT to Notify bridge") - client = mqtt.Client(userdata=topic) + client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, userdata=topic) client.tls_set() client.username_pw_set(user, password(user, broker)) -- cgit v1.2.3