Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple light show using phue
import time
from phue import Bridge
# connect to the hue bridge
b = Bridge(bridge_ip)
b.connect()
# Setup colors
colors = {
"bleu": [0.1393, 0.0813],
"blanc": [0.3062, 0.3151],
"rouge": [0.674, 0.322]
}
colorKeys = colors.keys()
# change each light color 10 times
for cycle in xrange(10):
for light in xrange(5):
# on each cycle, each light goes to the next color, which is
# either bleu, white or red.
next_color = colors[colorKeys[(cycle + light) % 3]]
b.set_light(light, 'xy', next_color, transitiontime=2.5)
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.