def __init__(self, num, ip, nameMap=None):
        super(DriverHue, self).__init__(num)

        if nameMap and len(nameMap) != self.numLEDs:
            raise ValueError(
                "nameMap must have the same number of entries as the number of LEDs.")

        self._bridge = Bridge(ip)
        self._bridge.connect()
        self._transitionTime = 0
        self._brightness = 254

        if nameMap:
            self._lights = self._bridge.get_light_objects('name')
            self._ids = nameMap
        else:
            self._lights = self._bridge.get_light_objects('id')
            self._ids = [l for l in self._lights]

        if len(self._lights) < self.numLEDs:
            raise ValueError(
                "More LEDs were specified than there are available Hue lights.")

        self.setTransitionTime(0)  # start with no transition time
dataset/ETHPy150Open ManiacalLabs/BiblioPixel/bibliopixel/drivers/hue.py/DriverHue.__init__/original