integration/homeassistant/custom_components/openaliro/sensor.py
openaliro/openaliro
Module

sensor.py

Distance sensor for the HA=1 OpenAliro direct integration.

integration/homeassistant/custom_components/openaliro/sensor.py8 documented symbols

Overview

Distance sensor for the HA=1 OpenAliro direct integration.

depends on const.py runtime.py

API

Fasync_setup_entry(hass: HomeAssistant, entry: ConfigEntry[OpenAliroRuntime], async_add_entities: AddEntitiesCallback) -> None

integration/homeassistant/custom_components/openaliro/sensor.py:14

Create the one supported distance entity.

calls OpenAliroDistanceSensor

Cclass OpenAliroDistanceSensor(SensorEntity)

integration/homeassistant/custom_components/openaliro/sensor.py:22

Latest valid UWB range, without peer or credential metadata.

called by async_setup_entry

FOpenAliroDistanceSensor.__init__(self, runtime: OpenAliroRuntime) -> None

integration/homeassistant/custom_components/openaliro/sensor.py:31

Initialize the distance sensor entity with the runtime reference and a unique ID derived from the device ID.

FOpenAliroDistanceSensor.available(self) -> bool

integration/homeassistant/custom_components/openaliro/sensor.py:38

Return whether the distance sensor is currently receiving valid range measurements from the lock.

FOpenAliroDistanceSensor.native_value(self) -> int | None

integration/homeassistant/custom_components/openaliro/sensor.py:43

Return the most recent measured distance to the lock in millimeters, or None if no measurement is available.

FOpenAliroDistanceSensor.device_info(self) -> DeviceInfo

integration/homeassistant/custom_components/openaliro/sensor.py:48

Return Home Assistant device metadata: a unique identifier derived from the lock's device ID and the openaliro manufacturer name.

FOpenAliroDistanceSensor.async_added_to_hass(self) -> None

integration/homeassistant/custom_components/openaliro/sensor.py:52

Register a listener callback that syncs the sensor state to Home Assistant when the runtime changes.

FOpenAliroDistanceSensor.async_will_remove_from_hass(self) -> None

integration/homeassistant/custom_components/openaliro/sensor.py:61

Unregister the listener callback on entity removal.

Undocumented (1)

OpenAliroDistanceSensor.update