From 9f7a333e40531490398e17210b1660f2946b9eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 16:16:16 +0100 Subject: [PATCH] added db request at script start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/app.py b/server/app.py index dcb51a3..45da9f5 100644 --- a/server/app.py +++ b/server/app.py @@ -43,7 +43,10 @@ db.autocommit(True) mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address -TUBE_INDEX = None +cur = db.cursor() +cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") +TUBE_INDEX = cur.fetchall() +cur.close() # Function to register a tube in the database def register_tube(mac_address):