From b627c53e3c3fa1adea83b9aebab95cd4e15a1de8 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 19 Dec 2013 15:17:45 +1100 Subject: [PATCH] lock: bugfix relating to recent changes to stopping alerts --- utils/lock.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/lock.py b/utils/lock.py index a3aa82a..f33d037 100755 --- a/utils/lock.py +++ b/utils/lock.py @@ -354,7 +354,7 @@ def wake_all(down_cnt, moment, typ, code, value): return if suspended: return - if type == 1 and code != 330: + if typ == 1 and code != 330: # EV_KEY but not BTN_TOUCH alert.stopall() display.on() @@ -377,12 +377,13 @@ def wake_dim(down_cnt, moment, typ, code, value): wake_all(down_cnt, moment, typ, code, value) def wake_toggle(down_cnt, moment, typ, code, value): - global state, last_set, enable_suspend, suspended + global state, last_set, enable_suspend, suspended, alert if suspended: return # ignore down, just get up if typ != 1 or value: return + alert.stopall() if ( state == "full" or state == "disable" ) and get_ticks() - last_set > 0.5: enable_suspend = True last_set = 0 -- 2.39.5