states should not control the keypad buffer
This commit is contained in:
parent
39bcda0404
commit
d5d2ce6abc
|
@ -68,6 +68,7 @@ class KeypadListener:
|
|||
if self._buf == '':
|
||||
ctrlKeySound.play()
|
||||
elif self._buf == passwd:
|
||||
self.resetBuffer()
|
||||
callbackDisarm()
|
||||
else:
|
||||
self.resetBuffer()
|
||||
|
@ -75,6 +76,7 @@ class KeypadListener:
|
|||
|
||||
# arm
|
||||
elif val == 'NUML':
|
||||
self.resetBuffer()
|
||||
callbackArm()
|
||||
ctrlKeySound.play()
|
||||
|
||||
|
|
|
@ -181,14 +181,8 @@ class StateMachine:
|
|||
|
||||
self._addManaged(PipeListener(callback=secretCallback, name= 'secret'))
|
||||
|
||||
keypadListener = self._addManaged(
|
||||
KeypadListener(
|
||||
stateMachine = self,
|
||||
callbackDisarm = self.DISARM,
|
||||
callbackArm = self.ARM,
|
||||
passwd = '5918462'
|
||||
)
|
||||
)
|
||||
self._addManaged(KeypadListener(stateMachine=self, callbackDisarm=self.DISARM,
|
||||
callbackArm=self.ARM, passwd='5918462'))
|
||||
|
||||
def startTimer(t, sound):
|
||||
self._timer = _CountdownTimer(t, self.TIMOUT, sound)
|
||||
|
@ -232,9 +226,6 @@ class StateMachine:
|
|||
)
|
||||
]
|
||||
|
||||
for obj in stateObjs:
|
||||
obj.entryCallbacks.append(keypadListener.resetBuffer)
|
||||
|
||||
self.states = st = namedtuple('States', [obj.name for obj in stateObjs])(*stateObjs)
|
||||
|
||||
st.disarmed.addTransition( _SIGNALS.ARM, st.disarmedCountdown)
|
||||
|
|
Loading…
Reference in New Issue