From caf26b9a7f5cff46b9902fb12b488d7a52d52e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 13 Feb 2024 15:58:40 +0100 Subject: [PATCH] added breake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/server/app.py b/server/app.py index c44820c..1374dd2 100644 --- a/server/app.py +++ b/server/app.py @@ -118,18 +118,20 @@ def mqtt_publisher(universe, artnetPacket): mqtt_client = connect_mqtt() try: while True: - if artnetPacket is not None and artnetPacket.data is not None: - if artnetPacket.universe == universe: - dmxPacket = artnetPacket.data - if dmxPacket is not None: - for i in len(512): - # # Create MQTT topic based on the universe and channel - # topic = f"{universe}/{channel}" - - # # Publish the DMX value to the MQTT topic - # mqtt_client.publish(topic, value) - print(dmxPacket[i-1], end=" ") - + try: + if artnetPacket is not None and artnetPacket.data is not None: + if artnetPacket.universe == universe: + dmxPacket = artnetPacket.data + if dmxPacket is not None: + for i in len(512): + # # Create MQTT topic based on the universe and channel + # topic = f"{universe}/{channel}" + + # # Publish the DMX value to the MQTT topic + # mqtt_client.publish(topic, value) + print(dmxPacket[i-1], end=" ") + except KeyboardInterrupt: + break except Exception as e: print(f"Error in universe {universe}: {e}")