From 24683e6507da846620b4efb337552bd81fb51103 Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Sun, 21 Jul 2019 23:17:18 +0200 Subject: [PATCH] fix bug for green light not turning off --- alert-api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/alert-api.py b/alert-api.py index ce07eb6..d7b5964 100644 --- a/alert-api.py +++ b/alert-api.py @@ -97,6 +97,9 @@ while True: time.sleep(.5) + # Turn green off, if on. It should only be on for one cycle + setColor('green', False) + for c, v in colors.items(): if c == 'green': continue @@ -108,7 +111,7 @@ while True: if v['prev'] > Counter(d[c])['active'] and v['steady']: setColor('green', True) - v['prev'] = Counter(d[c])['active'] + colors[c]['prev'] = Counter(d[c])['active'] print(time.time() - start) print('---')