OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
environmental.ambient_light_controller.AmbientLightController Class Reference

Provide validated ambient illuminance from a configured sensor. More...

Inheritance diagram for environmental.ambient_light_controller.AmbientLightController:
environmental.ambient_light_controller_if.AmbientLightControllerIf

Public Member Functions

bool is_started (self)
 Return whether the controller is ready to read state.
 
bool is_available (self)
 Return whether ambient light support is available.
 
str|None status_message (self)
 Return an availability message, if one applies.
 
AmbientLightState|None latest_state (self)
 Return the latest state, or None before the first read.
 
None start (self)
 Start the controller and its ambient light sensor.
 
None stop (self)
 Stop the controller and its ambient light sensor.
 
AmbientLightState read_state (self)
 Read and return the current ambient light state.
 

Detailed Description

Provide validated ambient illuminance from a configured sensor.

Member Function Documentation

◆ is_available()

bool environmental.ambient_light_controller.AmbientLightController.is_available (   self)

Return whether ambient light support is available.

Returns
True when an ambient light source is available.

Reimplemented from environmental.ambient_light_controller_if.AmbientLightControllerIf.

◆ is_started()

bool environmental.ambient_light_controller.AmbientLightController.is_started (   self)

Return whether the controller is ready to read state.

Returns
True when the controller has started and can read state.

Reimplemented from environmental.ambient_light_controller_if.AmbientLightControllerIf.

◆ latest_state()

AmbientLightState | None environmental.ambient_light_controller.AmbientLightController.latest_state (   self)

Return the latest state, or None before the first read.

Returns
Most recently sampled ambient light state, or None when unread.

Reimplemented from environmental.ambient_light_controller_if.AmbientLightControllerIf.

◆ read_state()

AmbientLightState environmental.ambient_light_controller.AmbientLightController.read_state (   self)

Read and return the current ambient light state.

Returns
Newly sampled ambient light state.

Reimplemented from environmental.ambient_light_controller_if.AmbientLightControllerIf.

◆ status_message()

str | None environmental.ambient_light_controller.AmbientLightController.status_message (   self)

Return an availability message, if one applies.

Returns
Availability/status message, or None when no message applies.

Reimplemented from environmental.ambient_light_controller_if.AmbientLightControllerIf.


The documentation for this class was generated from the following file: