From f0b039558cb89e7dbe35229696da568a3a26304e Mon Sep 17 00:00:00 2001 From: Jeroen Stroeve Date: Sun, 22 Sep 2024 20:47:45 +0200 Subject: [PATCH] Update buttons every hour --- pi-config/doorduino.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pi-config/doorduino.py b/pi-config/doorduino.py index bfee035..e494e01 100755 --- a/pi-config/doorduino.py +++ b/pi-config/doorduino.py @@ -220,7 +220,7 @@ def git_update(git_dir): return True -def git_thread(): +def update_buttons(): global ser global buttons print("GIT init") @@ -269,6 +269,11 @@ def git_thread(): # else: # 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): @@ -304,8 +309,7 @@ def main(argv): threading.Thread(target = threadwrap(serial_monitor_thread)).start() time.sleep(5) # Give doorduino time to start before sending spacestate data threading.Thread(target = threadwrap(mqtt_thread)).start() - # threading.Thread(target = threadwrap(git_thread)).start() - git_thread() + threading.Thread(target = threadwrap(git_thread)).start() if __name__ == "__main__":