OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
lighting.lighting_controller_if.LightingControllerIf Class Reference

Thread-friendly controller contract for lighting applications. More...

Public Member Functions

bool is_connected (self)
 Return whether the controller is connected to its lighting device.
LightingState current_state (self)
 Return the most recently requested lighting state.
Future[None] connect (self)
 Begin connecting to the lighting device.
Future[None] disconnect (self)
 Begin disconnecting from the lighting device.
None close (self)
 Release controller resources and prevent further operations.
Future[None] set_power (self, bool enabled)
 Set lighting power.
Future[None] set_color (self, RgbColor color)
 Set the static RGB color.
Future[None] set_brightness (self, int percent)
 Set brightness as a percentage.
Future[None] set_color_temperature (self, int percent)
 Set the warm-to-cool white balance.
Future[None] set_pattern (self, int pattern_index)
 Select a built-in lighting pattern.
Future[None] set_music_mode (self, int eq_mode)
 Select a sound-reactive equalizer mode.
Future[None] set_custom_pattern_mode (self, CustomPatternMode mode)
 Set the animation mode for a custom pattern.
Future[None] set_custom_pattern_direction (self, bool is_forward)
 Set the animation direction for a custom pattern.

Detailed Description

Thread-friendly controller contract for lighting applications.

Member Function Documentation

◆ connect()

Future[None] lighting.lighting_controller_if.LightingControllerIf.connect ( self)

Begin connecting to the lighting device.

Returns
Future completed when the device is ready, or completed with the connection exception.

◆ current_state()

LightingState lighting.lighting_controller_if.LightingControllerIf.current_state ( self)

Return the most recently requested lighting state.

Returns
Immutable snapshot of connection and lighting settings.

◆ disconnect()

Future[None] lighting.lighting_controller_if.LightingControllerIf.disconnect ( self)

Begin disconnecting from the lighting device.

Returns
Future completed when disconnection finishes, or completed with the disconnection exception.

◆ is_connected()

bool lighting.lighting_controller_if.LightingControllerIf.is_connected ( self)

Return whether the controller is connected to its lighting device.

Return values
TrueThe device connection is active.
FalseThe device is disconnected.

◆ set_brightness()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_brightness ( self,
int percent )

Set brightness as a percentage.

Parameters
percentBrightness in the inclusive range 0 through 100.
Returns
Future completed when the command has been processed.

◆ set_color()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_color ( self,
RgbColor color )

Set the static RGB color.

Parameters
colorRed, green, and blue channel values.
Returns
Future completed when the command has been processed.

◆ set_color_temperature()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_color_temperature ( self,
int percent )

Set the warm-to-cool white balance.

Parameters
percentColor temperature percentage accepted by the device.
Returns
Future completed when the command has been processed.

◆ set_custom_pattern_direction()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_custom_pattern_direction ( self,
bool is_forward )

Set the animation direction for a custom pattern.

Parameters
is_forwardTrue for forward animation.
Returns
Future completed when the command has been processed.

◆ set_custom_pattern_mode()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_custom_pattern_mode ( self,
CustomPatternMode mode )

Set the animation mode for a custom pattern.

Parameters
modeCustom animation mode.
Returns
Future completed when the command has been processed.

◆ set_music_mode()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_music_mode ( self,
int eq_mode )

Select a sound-reactive equalizer mode.

Parameters
eq_modeDevice-specific equalizer mode.
Returns
Future completed when the command has been processed.

◆ set_pattern()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_pattern ( self,
int pattern_index )

Select a built-in lighting pattern.

Parameters
pattern_indexDevice-specific pattern index.
Returns
Future completed when the command has been processed.

◆ set_power()

Future[None] lighting.lighting_controller_if.LightingControllerIf.set_power ( self,
bool enabled )

Set lighting power.

Parameters
enabledTrue to turn the lights on.
Returns
Future completed when the command has been processed.

The documentation for this class was generated from the following file:
  • controllers/lighting/lighting_controller_if.py