libstp.ui.screens.wfl

Wait-for-light screens: calibration (legacy) and auto-detection.

Classes

WFLMeasureResult

Result from WFLMeasureScreen.

WFLMeasureScreen

Measure light on or off state for wait-for-light calibration.

WFLConfirmResult

Result from WFLConfirmScreen.

WFLConfirmScreen

Confirm wait-for-light calibration values.

WFLDetectScreen

Status display for automatic wait-for-light detection.

Module Contents

class libstp.ui.screens.wfl.WFLMeasureResult

Result from WFLMeasureScreen.

value: float
class libstp.ui.screens.wfl.WFLMeasureScreen(port: int, is_on: bool)

Bases: libstp.ui.screen.UIScreen[WFLMeasureResult]

Measure light on or off state for wait-for-light calibration.

Shows light bulb visualization and real-time sensor reading. Returns sensor value when button is pressed.

title = 'Wait for Light Calibration'
port
is_on
build() libstp.ui.widgets.Widget

Build the screen layout.

Called on every render. Return a Widget tree describing what to display.

async on_press()
class libstp.ui.screens.wfl.WFLConfirmResult

Result from WFLConfirmScreen.

confirmed: bool
light_off: float
light_on: float
property threshold: float
class libstp.ui.screens.wfl.WFLConfirmScreen(port: int, light_off: float, light_on: float)

Bases: libstp.ui.screen.UIScreen[WFLConfirmResult]

Confirm wait-for-light calibration values.

Shows measured values (editable), threshold, and difference. User can confirm or retry.

title = 'Wait for Light Calibration'
port
light_off
light_on
property threshold: float
property difference: float
property is_good: bool
build() libstp.ui.widgets.Widget

Build the screen layout.

Called on every render. Return a Widget tree describing what to display.

async on_off_change(value: float)
async on_on_change(value: float)
async on_retry()
async on_confirm()
class libstp.ui.screens.wfl.WFLDetectScreen

Bases: libstp.ui.screen.UIScreen[None]

Status display for automatic wait-for-light detection.

Shows the current sensor value, Kalman-filtered baseline, trigger threshold, and detection status (WARMING UP / ARMED / GO!). This screen is display-only — no user interaction needed.

title = 'Wait for Light'
status: str = 'WARMING UP'
status_color: str = 'amber'
raw_value: int = 0
baseline: float = 0.0
threshold: float = 0.0
build() libstp.ui.widgets.Widget

Build the screen layout.

Called on every render. Return a Widget tree describing what to display.