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)

Holds color definition for UI LEDs. Color values range from 0 to 255. When outside of this range, the values are clamped

red

Red component of the color, in range from 0 to 255. When set to a value outside of this range, the value is clamped

green

Green component of the color, in range from 0 to 255. When set to a value outside of this range, the value is clamped

blue

Blue component of the color, in range from 0 to 255. When set to a value outside of this range, the value is clamped

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: Union[ButtonId, UiEventsListener.Button,
                                 UiEventsListener.Knob],
                   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.

Arguments:

  • target: Target button to change color. When Using UiEventsListener.any_button and UiEventsListener.any_button_incl_knob, all respective buttons change color/animation.
  • animation: Target animation.
  • color: Target color. When unfilled default color from settings 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.

Arguments:

  • enabled: Whether to animate knob rotation.