From 594509ef112e55e1d4d8fbb89e4a11be04d92084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 13 Feb 2024 00:22:20 +0100 Subject: [PATCH] fixed call back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/app.py b/server/app.py index 67045e9..ede4e26 100644 --- a/server/app.py +++ b/server/app.py @@ -97,13 +97,14 @@ def get_eth0_ip(): except (KeyError, IndexError, OSError) as e: print(f"Error getting eth0 IP: {e}") return None - -def connect_mqtt(): - def on_connect(client, userdata, flags, rc): + +def on_connect(client, rc, flags): if rc == 0: print("Connected to MQTT Broker!") else: print("Failed to connect, return code %d\n", rc) + +def connect_mqtt(): # Set Connecting Client ID client = mqtt.Client("mqtt_client_id") # client.username_pw_set(username, password)