Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Causes Philips Hue lights to flicker
from qhue import Bridge
import time
import random
import sys
bridge_ip = "<hue_ip_address>"
username = "<username>"
my_lights = [light_id_1, light_id_2]
def flicker(bridge, elapsed_time, lights_list = [], transition = 10):
start_time= time.time()
while (time.time() - start_time < elapsed_time):
for light in lights_list:
for light in lights_list:
bridge.lights[light].state(transitiontime=random.randint(0, transiti
on), on=False)
b = Bridge(bridge_ip_address, username)
flicker(b, float(sys.argv[1]), my_lights, transition = 1)
for light in light_list:
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.