added breake

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-13 15:58:40 +01:00
parent c4e662ee94
commit caf26b9a7f
1 changed files with 14 additions and 12 deletions

View File

@ -118,18 +118,20 @@ def mqtt_publisher(universe, artnetPacket):
mqtt_client = connect_mqtt() mqtt_client = connect_mqtt()
try: try:
while True: while True:
if artnetPacket is not None and artnetPacket.data is not None: try:
if artnetPacket.universe == universe: if artnetPacket is not None and artnetPacket.data is not None:
dmxPacket = artnetPacket.data if artnetPacket.universe == universe:
if dmxPacket is not None: dmxPacket = artnetPacket.data
for i in len(512): if dmxPacket is not None:
# # Create MQTT topic based on the universe and channel for i in len(512):
# topic = f"{universe}/{channel}" # # 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) # # Publish the DMX value to the MQTT topic
print(dmxPacket[i-1], end=" ") # mqtt_client.publish(topic, value)
print(dmxPacket[i-1], end=" ")
except KeyboardInterrupt:
break
except Exception as e: except Exception as e:
print(f"Error in universe {universe}: {e}") print(f"Error in universe {universe}: {e}")