move secrets to config

This commit is contained in:
petrucci4prez 2017-06-24 00:24:31 -04:00
parent dab054099c
commit 2775a9a4b9
2 changed files with 8 additions and 8 deletions

View File

@ -8,3 +8,9 @@ gluster:
volume: pyledriver
mountpoint: /mnt/glusterfs/pyledriver
options: backupvolfile-server=example.com
secretTable:
DISARM: labrie
ARM: petrucci
INSTANT_ARM: rudess
LOCK: myung
INSTANT_LOCK: portnoy

View File

@ -16,7 +16,7 @@ from functools import partial
from collections import namedtuple
from exceptionThreading import ExceptionThread
from config import stateFile
from config import configFile, stateFile
from sensors import startDoorSensor, startMotionSensor
from gmail import intruderAlert
from listeners import KeypadListener, PipeListener
@ -168,13 +168,7 @@ class StateMachine:
for sig in _SIGNALS:
setattr(self, sig.name, partial(self.selectState, sig))
secretTable = {
'dynamoHum': self.DISARM,
'zombyWoof': self.ARM,
'imTheSlime': self.INSTANT_ARM,
'fiftyFifty': self.LOCK,
'dentalFloss': self.INSTANT_LOCK
}
secretTable = {secret: getattr(self, signal) for signal, secret in configFile['secretTable'].items()}
def secretCallback(secret, logger):
if secret in secretTable: