-
Notifications
You must be signed in to change notification settings - Fork 0
/
begin.py
36 lines (28 loc) · 876 Bytes
/
begin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import logging
import time
from subprocess import call
import constants
from motion_detection import FearsEye
from music import HorrorsEar
log = logging.getLogger(__file__)
class FearItself(object):
def __init__(self):
self.ear = HorrorsEar()
self.eye = FearsEye()
def begin(self):
self.ear.begin()
self.eye.action_methods.append(getattr(self.ear, 'scare'))
self.eye.action_methods.append(self.fears_shroud)
self.eye.begin()
@staticmethod
def fears_shroud():
try:
call(constants.SMOKE_SCRIPT)
log.info('Running smoke machine')
time.sleep(constants.SMOKE_DURATION)
log.info('Stopping smoke machine')
call(constants.SMOKE_SCRIPT)
except Exception as e:
log.error(e)
if __name__ == '__main__':
FearItself().begin()