def __init__(self): CONTROLLER_ADDRESS = "192.168.1.119" self.led = ledcontroller.LedController(CONTROLLER_ADDRESS) self.group = 0 #Limitless LED Bulb Bridge Group of LEDs to use. 0 is all. # Create a new instance of the button client. Does nothing until start() is called self.the_button = TheButton() self.last_lowest = 60.0
def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Gets the LimitlessLED lights. """ import ledcontroller led = ledcontroller.LedController(config['host']) lights = [] for i in range(1, 5): if 'group_%d_name' % (i) in config: lights.append(LimitlessLED(led, i, config['group_%d_name' % (i)])) add_devices_callback(lights)
def main(argv): cmd = '' value = '' zone = '' led = ledcontroller.LedController("192.168.0.150") try: opts, args = getopt.getopt(argv,"hc:v:z:",["cmd=","value=","zone="]) except getopt.GetoptError: print 'lights.py -c <command> -v <value> -z <value>' sys.exit(2) for opt, arg in opts: if opt == '-h': print 'lights.py -c <command> -v <value> -z <value>' sys.exit() elif opt in ("-c", "--cmd"): cmd = arg elif opt in ("-v", "--value"): value = arg elif opt in ("-z", "--zone"): try: zone = int(arg) except ValueError: zone = None print 'Command is :', cmd print 'Value is :', value print 'Zone is :', zone led.set_group_type(1,'rgbw') if cmd == 'on' and value == 'white': led.on(zone) led.set_color('white', zone) if cmd == 'on' and value == 'red': led.on(zone) led.set_color('red', zone) if cmd == 'on' and value == 'green': led.on(zone) led.set_color('green', zone) if cmd == 'on' and value == 'blue': led.on(zone) led.set_color('royal_blue', zone) if cmd == 'off': led.set_color('white', zone) led.off(zone) if cmd == 'dim': if zone == None: led.set_brightness(int(value)) else: led.set_brightness(int(value), zone)
def setup_platform(hass, config, add_devices_callback, discovery_info=None): """ Gets the LimitlessLED lights. """ try: import ledcontroller except ImportError: _LOGGER.exception("Error while importing dependency ledcontroller.") return led = ledcontroller.LedController(config['host']) lights = [] for i in range(1, 5): if 'group_%d_name' % (i) in config: lights.append( LimitlessLED( led, i, config['group_%d_name' % (i)] ) ) add_devices_callback(lights)
import ledcontroller led = ledcontroller.LedController("192.168.1.30") led.white()
#!/usr/bin/python import getopt, sys import ledcontroller controller_ip = '192.168.1.30' led = ledcontroller.LedController(controller_ip, port=8899, repeat_commands=3, pause_between_commands=0.1) def lights_on(groups=None): print "lights_on: %r " % groups if groups is None or len(groups) == 0: led.on() else: try: for group in groups: led.on(int(group)) except: pass def lights_off(groups=None): if groups is None or len(groups) == 0: led.off() else: try: for group in groups: led.off(int(group)) except:
import ledcontroller import time led = ledcontroller.LedController("10.0.0.5", pause_between_commands=0.05) led.on(1) led.white(1) led.off(1) led.on(1) led.off(1) led.on(1) led.off(1) led.on(1) led.white(1)