From 79bc7c38e6e7a45fe1ce87e01380092079bfc433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Wed, 14 Feb 2024 22:12:06 +0100 Subject: [PATCH] added try to for 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, 4 insertions(+), 6 deletions(-) diff --git a/server/app.py b/server/app.py index 15ba2d1..afb7f21 100644 --- a/server/app.py +++ b/server/app.py @@ -126,17 +126,15 @@ def start_mqtt_publishers(universe_count): #Checks to see if the current packet is for the specified DMX Universe dmxPacket = artNetPacket.data print(str(dmxPacket)) - try: - for i in range(512): + for i in range(512): + try: # Create MQTT topic based on the universe and channel topic = f"{str(artNetPacket.universe)}/{str(i)}" # Publish the DMX value to the MQTT topic mqtt_client.publish(topic, str(dmxPacket[i-1])) - except Exception as e: - print(f"Error in universes {str(artNetPacket.universe)}: {e}") - except KeyboardInterrupt: - break + except KeyboardInterrupt: + break except Exception as e: print(e)