def switchlight(bridge, light_id, lighton): light = Light(bridge, light_id) light.xy = [1, 1] if lighton: light.brightness = 255 else: light.brightness = 0
def alarmsignal(bridge, light_id, color_xy=[0.675, 0.305]): light = Light(bridge, light_id) old_brightness = light.brightness old_xy = light.xy print(old_xy) light.xy = color_xy for i in range(0, 5): light.brightness = 254 time.sleep(0.3) light.brightness = 1 time.sleep(0.5) light.brightness = old_brightness light.xy = old_xy
def setBright(): vvalue = w.get() test_light.brightness = vvalue b = Bridge('192.168.1.17') lights = b.lights #listLumiere() bureau1 = Light(b, 'Sous-sol A1') bureau2 = Light(b, 'Sous-sol A2') test_light = Light(b, 'Sous-sol A1') test_light.on = False test_light.on = True test_light.brightness = 254 test_light.saturation = 254 #test_light.effect = "colorloop" #colorLoop() while (True): colorSwitch() # colorLoop() #bureau1.on = False #bureau2.on = False #bureau1.on = True #bureau2.on = True #bur1ColorMode = bureau1.colormode #print(bur1ColorMode)