integration/homeassistant/src/openaliro_ha/compatibility.py
openaliro/openaliro
Module
compatibility.py
Incremental parser for the source-proven `aliro range` compatibility mode.
Overview
Incremental parser for the source-proven `aliro range` compatibility mode.
depends on models.py parser.py · used by __init__.py serial_session.py
API
Cclass RangeResponseParser
integration/homeassistant/src/openaliro_ha/compatibility.py:18
Parse one explicitly started `aliro range` command response at a time.
FRangeResponseParser.__init__(self) -> None
integration/homeassistant/src/openaliro_ha/compatibility.py:21
Initialize a range response parser. Sets all internal state to inactive with no measurements.
FRangeResponseParser.begin(self) -> None
integration/homeassistant/src/openaliro_ha/compatibility.py:30
Start a new response, discarding any interrupted prior response.
FRangeResponseParser.feed_line(self, line: str) -> Optional[CompatibilityRangeReading]
integration/homeassistant/src/openaliro_ha/compatibility.py:40
Accept one response line and emit only a complete, internally valid reading.
calls
RangeResponseParser._complete_readingFRangeResponseParser.finished(self) -> bool
integration/homeassistant/src/openaliro_ha/compatibility.py:70
Whether the active response reached a safe terminal line.
FRangeResponseParser._complete_reading(self, trusted: bool) -> Optional[CompatibilityRangeReading]
integration/homeassistant/src/openaliro_ha/compatibility.py:75
Emit a complete reading if all four measurements (distance, NLOS, block, age) are present and non-negative; return None otherwise.
called by
RangeResponseParser.feed_line