Update buttons every hour

This commit is contained in:
Jeroen Stroeve 2024-09-22 20:47:45 +02:00
parent 43c0371177
commit f0b039558c

View file

@ -220,7 +220,7 @@ def git_update(git_dir):
return True return True
def git_thread(): def update_buttons():
global ser global ser
global buttons global buttons
print("GIT init") print("GIT init")
@ -269,6 +269,11 @@ def git_thread():
# else: # else:
# print("should be there " + button) # print("should be there " + button)
def git_thread():
print("Updating buttons")
update_buttons()
print("Update buttons finished, sleeping for 3600 seconds")
time.sleep(3600)
def threadwrap(threadfunc): def threadwrap(threadfunc):
@ -304,8 +309,7 @@ def main(argv):
threading.Thread(target = threadwrap(serial_monitor_thread)).start() threading.Thread(target = threadwrap(serial_monitor_thread)).start()
time.sleep(5) # Give doorduino time to start before sending spacestate data time.sleep(5) # Give doorduino time to start before sending spacestate data
threading.Thread(target = threadwrap(mqtt_thread)).start() threading.Thread(target = threadwrap(mqtt_thread)).start()
# threading.Thread(target = threadwrap(git_thread)).start() threading.Thread(target = threadwrap(git_thread)).start()
git_thread()
if __name__ == "__main__": if __name__ == "__main__":