forked from Derrick-Sherrill/DerrickSherrill.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhue_lights.py
35 lines (28 loc) · 888 Bytes
/
hue_lights.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
from phue import Bridge
from ip_address import bridge_ip_address
import time
def access_lights(bridge_ip_address):
b = Bridge(bridge_ip_address)
light_names_list = b.get_light_objects('name')
return light_names_list
def film_lights():
lights = access_lights(bridge_ip_address)
for light in lights:
lights[light].on = True
lights[light].hue = 7000
lights[light].saturation = 100
def danger_mode():
lights = access_lights(bridge_ip_address)
while True:
time.sleep(1)
for light in lights:
lights[light].on = True
lights[light].hue = 180
lights[light].saturation = 100
time.sleep(1)
for light in lights:
lights[light].on = True
lights[light].hue = 7000
lights[light].saturation = 100
if __name__ == '__main__':
film_lights()