State
busylight_core.vendors.agile_innovative.implementation.state
¶
Agile Innovative BlinkStick device state management.
This module defines the State class that manages command construction for BlinkStick devices, including LED arrays and color format conversion.
Classes¶
busylight_core.vendors.agile_innovative.implementation.state.State
¶
BlinkStick State manager for multi-LED devices.
BlinkStick devices store colors in Green-Red-Blue (GRB) format internally, while the public API uses the standard Red-Green-Blue (RGB) format. This class handles the conversion automatically and supports multiple device variants with different LED counts and report formats.
Initialize BlinkStick state.
:param report: HID report number for this device variant :param nleds: Number of LEDs supported by this device
Source code in src/busylight_core/vendors/agile_innovative/implementation/state.py
Attributes¶
busylight_core.vendors.agile_innovative.implementation.state.State.report
instance-attribute
¶
busylight_core.vendors.agile_innovative.implementation.state.State.nleds
instance-attribute
¶
busylight_core.vendors.agile_innovative.implementation.state.State.channel
instance-attribute
¶
busylight_core.vendors.agile_innovative.implementation.state.State.colors
instance-attribute
¶
busylight_core.vendors.agile_innovative.implementation.state.State.color
property
writable
¶
Get the current RGB color of the first lit LED.
Returns the color of the first LED that has a non-zero color value, converted from internal GRB format to standard RGB format.
Functions¶
busylight_core.vendors.agile_innovative.implementation.state.State.blinkstick
classmethod
¶
busylight_core.vendors.agile_innovative.implementation.state.State.blinkstick_pro
classmethod
¶
busylight_core.vendors.agile_innovative.implementation.state.State.blinkstick_square
classmethod
¶
busylight_core.vendors.agile_innovative.implementation.state.State.blinkstick_strip
classmethod
¶
busylight_core.vendors.agile_innovative.implementation.state.State.blinkstick_nano
classmethod
¶
busylight_core.vendors.agile_innovative.implementation.state.State.blinkstick_flex
classmethod
¶
busylight_core.vendors.agile_innovative.implementation.state.State.rgb_to_grb
staticmethod
¶
Convert RGB color tuple to internal GRB representation.
:param color: RGB color tuple (red, green, blue) :return: GRB color tuple (green, red, blue)
Source code in src/busylight_core/vendors/agile_innovative/implementation/state.py
busylight_core.vendors.agile_innovative.implementation.state.State.grb_to_rgb
staticmethod
¶
Convert internal GRB color tuple to RGB representation.
:param color: GRB color tuple (green, red, blue) :return: RGB color tuple (red, green, blue)
Source code in src/busylight_core/vendors/agile_innovative/implementation/state.py
busylight_core.vendors.agile_innovative.implementation.state.State.get_led
¶
Get the RGB color of a specific LED.
:param index: LED index (0-based) :return: RGB color tuple, or (0,0,0) if index is invalid
Source code in src/busylight_core/vendors/agile_innovative/implementation/state.py
busylight_core.vendors.agile_innovative.implementation.state.State.set_led
¶
Set the RGB color of a specific LED.
:param index: LED index (0-based) :param color: RGB color tuple to set