From 17ae6220abd7c7ea30c0d5e802451933900309e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 03:02:20 +0100 Subject: [PATCH] fixed subs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/server/app.py b/server/app.py index 65387c0..33d51dd 100644 --- a/server/app.py +++ b/server/app.py @@ -127,12 +127,8 @@ def start_mqtt_publishers(): cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") result = cur.fetchall() for row in result: - print(row[0]) - print(row[1]) - print(row[2]) - dmx_address = int(row[2]) - if artNetPacket.universe == int(row[2]): + if artNetPacket.universe == int(row[1]): #Define RGB values per pixel p1_r = dmxPacket[dmx_address+0+0] p1_g = dmxPacket[dmx_address+0+1] @@ -159,12 +155,12 @@ def start_mqtt_publishers(): p6_b = dmxPacket[dmx_address+15+2] # Pixel topics - p1_topic = "tube-"+str(row[1])+"/p1" - p2_topic = "tube-"+str(row[1])+"/p2" - p3_topic = "tube-"+str(row[1])+"/p3" - p4_topic = "tube-"+str(row[1])+"/p4" - p5_topic = "tube-"+str(row[1])+"/p5" - p6_topic = "tube-"+str(row[1])+"/p6" + p1_topic = "tube-"+str(row[0])+"/p1" + p2_topic = "tube-"+str(row[0])+"/p2" + p3_topic = "tube-"+str(row[0])+"/p3" + p4_topic = "tube-"+str(row[0])+"/p4" + p5_topic = "tube-"+str(row[0])+"/p5" + p6_topic = "tube-"+str(row[0])+"/p6" # Publish pixel topic mqtt_client.publish(p1_topic, str([p1_r, p1_g, p1_b]))