def __getitem__(self, pos): """Return the 24-bit RGB color value at the provided position or slice of positions. """ # Handle if a slice of positions are passed in by grabbing all the values # and returning them in a list. if isinstance(pos, slice): return [ws.ws2811_led_get(self.channel, n) for n in range(pos.indices(self.size))] # Else assume the passed in value is a number to the position. else: return ws.ws2811_led_get(self.channel, pos)
def ws2811_led_get(*args): return _rpi_ws281x.ws2811_led_get(*args)
def get_led(self, n): return ws.ws2811_led_get(self._channel, n % self.size)
def ws2811_led_get(channel, lednum): return _rpi_ws281x.ws2811_led_get(channel, lednum)