forked from ben174/homecontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanual.py
43 lines (32 loc) · 811 Bytes
/
manual.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
37
38
39
40
41
42
43
#!/usr/bin/env python
from recorder import Recorder
from control import Control
from command import Command
import time
import logging
GPIO_PIN = 3
recorder = Recorder()
#control = Control()
logger = None
def main():
setup_logging()
while True:
button_press()
def button_press():
time.sleep(1)
command = recorder.record_command()
print command
#if command:
# control.execute_command(command)
return
command = Command(action='power', value='on')
recorder.control.execute_command(command)
def setup_logging():
# silence phue logging
phue_log = logging.getLogger("phue")
phue_log.setLevel(logging.WARNING)
global logger
logger = logging.getLogger("automate")
logger.setLevel(logging.DEBUG)
if __name__ == '__main__':
main()