added time debug for publishing

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-20 15:59:41 +01:00
parent ba5a91c46c
commit 9954a0b997
1 changed files with 3 additions and 1 deletions

View File

@ -135,6 +135,7 @@ def mqtt_publisher(ti_receiver):
tube_index = json.loads(tube_index) tube_index = json.loads(tube_index)
end = time.time() end = time.time()
print("Converting tube index back to list wtih leval took: "+str(end-start)) print("Converting tube index back to list wtih leval took: "+str(end-start))
start = time.time()
for index_row in tube_index: for index_row in tube_index:
if artNetPacket.universe == int(index_row[1]): if artNetPacket.universe == int(index_row[1]):
dmx_address = int(index_row[2]) dmx_address = int(index_row[2])
@ -149,7 +150,8 @@ def mqtt_publisher(ti_receiver):
result_str = [str(color) for color in colors] result_str = [str(color) for color in colors]
result = str(result_str) result = str(result_str)
mqtt_client.publish(p1_topic, result) mqtt_client.publish(p1_topic, result)
end = time.time()
print("Sending out to all tubes took: "+str(end-start))
except KeyboardInterrupt: except KeyboardInterrupt:
artNet.close() artNet.close()
def tube_index_updater(ti_queue): def tube_index_updater(ti_queue):