From a6e7c56ad6d7da4b034e979647b1c934d315c9d7 Mon Sep 17 00:00:00 2001 From: Sean Corrigan Date: Fri, 13 Nov 2020 19:06:48 -0500 Subject: [PATCH] Runloop --- PIcontroller.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PIcontroller.py b/PIcontroller.py index 8a0af0f..5224cac 100644 --- a/PIcontroller.py +++ b/PIcontroller.py @@ -30,8 +30,13 @@ def main(): response = requests.get("{}/queue?api={}".format(LoveBOXAPIurl,LoveBOXAPIapi), verify=True).content.decode() response = listfromAPI(response) if response == None: return - if len(response) <= 1: + if len(response) == 1: sendUpdate(response[0]) + requests.get("{}/clear?api={}".format(LoveBOXAPIurl,LoveBOXAPIapi), verify=True).content.decode() -main() \ No newline at end of file +if __name__ == "__main__": + while True: + main() + sleep(10) + \ No newline at end of file