added while loop to tube index updater
Signed-off-by: Ebbe Baß <ebbe.bass>
This commit is contained in:
+2
-1
@@ -152,6 +152,7 @@ def mqtt_publisher():
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
def tube_index_updater():
|
def tube_index_updater():
|
||||||
|
while True:
|
||||||
mqtt_client = connect_mqtt()
|
mqtt_client = connect_mqtt()
|
||||||
cur = db.cursor()
|
cur = db.cursor()
|
||||||
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
||||||
@@ -159,7 +160,7 @@ def tube_index_updater():
|
|||||||
cur.close()
|
cur.close()
|
||||||
mqtt_client.publish("pxm/tube_index", str(TUBE_INDEX))
|
mqtt_client.publish("pxm/tube_index", str(TUBE_INDEX))
|
||||||
print("Updated tube index")
|
print("Updated tube index")
|
||||||
time.sleep(1)
|
time.sleep(5)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user