move key passwd to config
This commit is contained in:
parent
2775a9a4b9
commit
501577d153
|
@ -14,3 +14,4 @@ secretTable:
|
|||
INSTANT_ARM: rudess
|
||||
LOCK: myung
|
||||
INSTANT_LOCK: portnoy
|
||||
keyPasswd: 123456
|
||||
|
|
|
@ -43,10 +43,14 @@ class KeypadListener:
|
|||
wrongPassSound = soundLib.soundEffects['wrongPass']
|
||||
backspaceSound = soundLib.soundEffects['backspace']
|
||||
|
||||
if not isinstance(passwd, int):
|
||||
logger.error('KeyPasswd must be int. Check configuration')
|
||||
raise SystemExit
|
||||
|
||||
def checkPasswd(action):
|
||||
if self._buf == '':
|
||||
ctrlKeySound.play()
|
||||
elif self._buf == passwd:
|
||||
elif self._buf == str(passwd):
|
||||
self.resetBuffer()
|
||||
action()
|
||||
else:
|
||||
|
|
|
@ -179,7 +179,7 @@ class StateMachine:
|
|||
|
||||
self._addManaged(PipeListener(callback=secretCallback, name='secret'))
|
||||
|
||||
self._addManaged(KeypadListener(stateMachine=self, passwd='5918462'))
|
||||
self._addManaged(KeypadListener(stateMachine=self, passwd=configFile['keyPasswd']))
|
||||
|
||||
def startTimer(t, sound):
|
||||
self._timer = _CountdownTimer(t, self.TIMOUT, sound)
|
||||
|
|
Loading…
Reference in New Issue