Skip to content

Instantly share code, notes, and snippets.

Created April 18, 2015 16:52
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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)
# 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment