Skip to content

brian.uicontrol

brian

UiEventsListenerAlreadyClosedError class objects

class UiEventsListenerAlreadyClosedError(Exception)

Thrown when trying to access closed UiEventsListener

LedColor class objects

class LedColor()

__init__

def __init__(red: int, green: int, blue: int)

red

green

blue

ButtonId class objects

class ButtonId(Enum)

TOP_LEFT

TOP_RIGHT

BOTTOM_LEFT

BOTTOM_RIGHT

KNOB

LedButtonAnimation class objects

class LedButtonAnimation(Enum)

Constants for selecting behavior of button LEDs. Only in use when LED animations are handled by Brian OS.

OFF

LED is fully off

STANDBY

LED is pulsing at low brightness level

SELECTABLE

LED is pulsing at medium brightness level

SELECTED

LED is pulsing at high brightness level

set_button_led

@staticmethod
def set_button_led(target: ButtonId,
                   animation: LedButtonAnimation,
                   color: LedColor = 'DEFAULT_COLOR_FROM_SETTINGS') -> None

Set desired animation and color for a specific button (target). These settings override the animation requested by the PhysButtonOverlay and the default os button effect, unless LedButtonAnimation._inherit is used.

enable_knob_rotation_animation

@staticmethod
def enable_knob_rotation_animation(enabled: bool) -> None

If enabled, OS automatically animates the LEDs under the knob when it rotates. The user program starts in the enabled state.

get_num_of_leds

@staticmethod
def get_num_of_leds() -> int

Returns:

number of available leds