-
Notifications
You must be signed in to change notification settings - Fork 0
/
hue.py
44 lines (36 loc) · 866 Bytes
/
hue.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
from phue import Bridge
import random,sys,time
def set_white(light):
light.brightness = 150
light.xy = [0,0]
def ack(light):
light.brightness = 150
light.xy = [0,0]
light.on = False
time.sleep(1)
light.on = True
def set_purple(light):
light.brightness = 150
light.xy = [.3,.2];
def set_red(light):
light.brightness = 150
light.xy = [.75,.3];
def set_yellow(light):
light.brightness = 127
light.xy = [1,1]
def hue_connect(addr):
bridge = None
not_connected = True
while(not_connected):
try:
bridge = Bridge(addr)
bridge.connect()
not_connected = False
except:
print("\nGo push the button on the hub to authorize this program. I'll wait.\n")
raw_input("Hit enter when you're done. ")
return bridge
#lights = hue_connect()
#lights[1].brightness = 10
#ack(lights[1])
#set_yellow(lights[1])