summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2024-05-16 22:56:08 -0400
committerMatt Turner <mattst88@gmail.com>2024-05-16 23:08:42 -0400
commit3c055ecf5615868d8ce9be932cddbcf59020fbab (patch)
treed1b5eec29d7e2f8532d8bea186129fbcb807b2cc
parent677735d0e3c9c48ce510caf136664f717005f1bf (diff)
mqtt-notify.py: Make compatible with paho-mqtt v2HEADmaster
-rwxr-xr-xmqtt-notify.py6
1 files 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))