parent
bedbf76b5f
commit
74fa0640ff
|
@ -152,14 +152,15 @@ def mqtt_publisher():
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
def tube_index_updater():
|
def tube_index_updater():
|
||||||
mqtt_client = connect_mqtt()
|
while True:
|
||||||
cur = db.cursor()
|
mqtt_client = connect_mqtt()
|
||||||
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
cur = db.cursor()
|
||||||
TUBE_INDEX = cur.fetchall()
|
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
||||||
cur.close()
|
TUBE_INDEX = cur.fetchall()
|
||||||
mqtt_client.publish("pxm/tube_index", str(TUBE_INDEX))
|
cur.close()
|
||||||
print("Updated tube index")
|
mqtt_client.publish("pxm/tube_index", str(TUBE_INDEX))
|
||||||
time.sleep(1)
|
print("Updated tube index")
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue