From ac0497438dcda9935f10ae55f5a0955dc79761c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 03:57:48 +0100 Subject: [PATCH] fixed cur MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/app.py b/server/app.py index 37e350d..e1942e2 100644 --- a/server/app.py +++ b/server/app.py @@ -41,13 +41,12 @@ db = MySQLdb.connect( ) db.autocommit(True) -cur = db.cursor() mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address # Function to register a tube in the database def register_tube(mac_address): - + cur = 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() @@ -115,6 +114,7 @@ def start_mqtt_publishers(): mqtt_client = connect_mqtt() artnetBindIp = get_eth0_ip() artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = True, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454) + cur = db.cursor() cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") global result result = cur.fetchall()