-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-interface.py
50 lines (40 loc) · 1.19 KB
/
test-interface.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
44
45
46
47
48
49
50
from zen_interface import ZenInterface
import yaml
import time
config = yaml.safe_load(open("test-config.yaml"))
zi = ZenInterface(narration=False)
zi.add_controller(**config.get('zencontrol')[0])
zi.start()
timer_start = time.time()
print("Profiles")
profiles = zi.get_profiles()
for profile in profiles:
print(f" • {profile}")
print("Lights")
lights = zi.get_lights()
for light in lights:
print(f" • {light}")
for group in light.groups:
print(f" • {group}")
print("Groups")
groups = zi.get_groups()
for group in groups:
print(f" • {group}")
for light in group.lights:
print(f" • {light}")
print("Buttons")
buttons = zi.get_buttons()
for button in buttons:
print(f" • {button}")
print("Motion sensors")
motion_sensors = zi.get_motion_sensors()
for motion_sensor in motion_sensors:
print(f" • {motion_sensor}")
print(f" = {'occupied' if motion_sensor.occupied else 'not occupied'}")
print("System variables")
system_variables = zi.get_system_variables()
for zsv in system_variables:
print(f" • {zsv}")
print(f" = {zsv.value}")
timer_end = time.time()
print(f"Time taken: {timer_end - timer_start} seconds")