From 3a48d09b5bb4cbe6b14458b33b5dffd27519550a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 13 Feb 2024 13:59:40 +0100 Subject: [PATCH] fixed non type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/server/app.py b/server/app.py index 52ea5c4..c987416 100644 --- a/server/app.py +++ b/server/app.py @@ -119,16 +119,17 @@ def mqtt_publisher(universe, artnetPacket): try: dmx_values = artnetPacket.data while True: - if artnetPacket.universe == universe: - if dmx_values is not None: - dmxPacket = artnetPacket.data - for i in dmx_values: - # # 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=" ") + if artnetPacket is not None and artnetPacket.data is not None: + if artnetPacket.universe == universe: + if dmx_values is not None: + dmxPacket = artnetPacket.data + for i in dmx_values: + # # 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 Exception as e: print(f"Error in universe {universe}: {e}")