move secrets to config
This commit is contained in:
parent
dab054099c
commit
2775a9a4b9
|
@ -8,3 +8,9 @@ gluster:
|
||||||
volume: pyledriver
|
volume: pyledriver
|
||||||
mountpoint: /mnt/glusterfs/pyledriver
|
mountpoint: /mnt/glusterfs/pyledriver
|
||||||
options: backupvolfile-server=example.com
|
options: backupvolfile-server=example.com
|
||||||
|
secretTable:
|
||||||
|
DISARM: labrie
|
||||||
|
ARM: petrucci
|
||||||
|
INSTANT_ARM: rudess
|
||||||
|
LOCK: myung
|
||||||
|
INSTANT_LOCK: portnoy
|
||||||
|
|
|
@ -16,7 +16,7 @@ from functools import partial
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
from exceptionThreading import ExceptionThread
|
from exceptionThreading import ExceptionThread
|
||||||
from config import stateFile
|
from config import configFile, stateFile
|
||||||
from sensors import startDoorSensor, startMotionSensor
|
from sensors import startDoorSensor, startMotionSensor
|
||||||
from gmail import intruderAlert
|
from gmail import intruderAlert
|
||||||
from listeners import KeypadListener, PipeListener
|
from listeners import KeypadListener, PipeListener
|
||||||
|
@ -168,13 +168,7 @@ class StateMachine:
|
||||||
for sig in _SIGNALS:
|
for sig in _SIGNALS:
|
||||||
setattr(self, sig.name, partial(self.selectState, sig))
|
setattr(self, sig.name, partial(self.selectState, sig))
|
||||||
|
|
||||||
secretTable = {
|
secretTable = {secret: getattr(self, signal) for signal, secret in configFile['secretTable'].items()}
|
||||||
'dynamoHum': self.DISARM,
|
|
||||||
'zombyWoof': self.ARM,
|
|
||||||
'imTheSlime': self.INSTANT_ARM,
|
|
||||||
'fiftyFifty': self.LOCK,
|
|
||||||
'dentalFloss': self.INSTANT_LOCK
|
|
||||||
}
|
|
||||||
|
|
||||||
def secretCallback(secret, logger):
|
def secretCallback(secret, logger):
|
||||||
if secret in secretTable:
|
if secret in secretTable:
|
||||||
|
|
Loading…
Reference in New Issue