libstp.ui.screens.wfl ===================== .. py:module:: libstp.ui.screens.wfl .. autoapi-nested-parse:: Wait-for-light screens: calibration (legacy) and auto-detection. Classes ------- .. autoapisummary:: libstp.ui.screens.wfl.WFLMeasureResult libstp.ui.screens.wfl.WFLMeasureScreen libstp.ui.screens.wfl.WFLConfirmResult libstp.ui.screens.wfl.WFLConfirmScreen libstp.ui.screens.wfl.WFLDetectScreen Module Contents --------------- .. py:class:: WFLMeasureResult Result from WFLMeasureScreen. .. py:attribute:: value :type: float .. py:class:: WFLMeasureScreen(port: int, is_on: bool) Bases: :py:obj:`libstp.ui.screen.UIScreen`\ [\ :py:obj:`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. .. py:attribute:: title :value: 'Wait for Light Calibration' .. py:attribute:: port .. py:attribute:: is_on .. py:method:: build() -> libstp.ui.widgets.Widget Build the screen layout. Called on every render. Return a Widget tree describing what to display. .. py:method:: on_press() :async: .. py:class:: WFLConfirmResult Result from WFLConfirmScreen. .. py:attribute:: confirmed :type: bool .. py:attribute:: light_off :type: float .. py:attribute:: light_on :type: float .. py:property:: threshold :type: float .. py:class:: WFLConfirmScreen(port: int, light_off: float, light_on: float) Bases: :py:obj:`libstp.ui.screen.UIScreen`\ [\ :py:obj:`WFLConfirmResult`\ ] Confirm wait-for-light calibration values. Shows measured values (editable), threshold, and difference. User can confirm or retry. .. py:attribute:: title :value: 'Wait for Light Calibration' .. py:attribute:: port .. py:attribute:: light_off .. py:attribute:: light_on .. py:property:: threshold :type: float .. py:property:: difference :type: float .. py:property:: is_good :type: bool .. py:method:: build() -> libstp.ui.widgets.Widget Build the screen layout. Called on every render. Return a Widget tree describing what to display. .. py:method:: on_off_change(value: float) :async: .. py:method:: on_on_change(value: float) :async: .. py:method:: on_retry() :async: .. py:method:: on_confirm() :async: .. py:class:: WFLDetectScreen Bases: :py:obj:`libstp.ui.screen.UIScreen`\ [\ :py:obj:`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. .. py:attribute:: title :value: 'Wait for Light' .. py:attribute:: status :type: str :value: 'WARMING UP' .. py:attribute:: status_color :type: str :value: 'amber' .. py:attribute:: raw_value :type: int :value: 0 .. py:attribute:: baseline :type: float :value: 0.0 .. py:attribute:: threshold :type: float :value: 0.0 .. py:method:: build() -> libstp.ui.widgets.Widget Build the screen layout. Called on every render. Return a Widget tree describing what to display.