From: NeilBrown Date: Thu, 19 Dec 2013 04:17:45 +0000 (+1100) Subject: lock: bugfix relating to recent changes to stopping alerts X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=b627c53e3c3fa1adea83b9aebab95cd4e15a1de8;p=plato.git lock: bugfix relating to recent changes to stopping alerts --- 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