From 8ece5779ae27c77102219a8ed977cd194b28fcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 17:08:25 +0100 Subject: [PATCH] debug tedt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/app.py b/server/app.py index a7ed2a3..fe536f8 100644 --- a/server/app.py +++ b/server/app.py @@ -45,18 +45,18 @@ mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address # Function to register a tube in the database def register_tube(mac_address): - cur = db.cursor() + cur1 = db.cursor() # Check if the tube already exists in the database - cur.execute("SELECT * FROM tubes WHERE mac_address = %s", (mac_address,)) - existing_tube = cur.fetchone() + cur1.execute("SELECT * FROM tubes WHERE mac_address = %s", (mac_address,)) + existing_tube = cur1.fetchone() # Check if the tube exsist. If it doesn't create a new db row if not existing_tube: - cur.execute("INSERT INTO tubes (mac_address, universe, dmx_address) VALUES (%s, %s, %s)", + cur1.execute("INSERT INTO tubes (mac_address, universe, dmx_address) VALUES (%s, %s, %s)", (mac_address, 0, 1)) else: pass - cur.close() + cur1.close() # Registration system route @app.route('/register_tube', methods=['POST'])