mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Improve proximity typing (#65053)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
c3967dec10
commit
3a45168b97
@ -70,14 +70,14 @@ def setup_proximity_component(
|
|||||||
hass: HomeAssistant, name: str, config: ConfigType
|
hass: HomeAssistant, name: str, config: ConfigType
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Set up the individual proximity component."""
|
"""Set up the individual proximity component."""
|
||||||
ignored_zones = config.get(CONF_IGNORED_ZONES)
|
ignored_zones: list[str] = config[CONF_IGNORED_ZONES]
|
||||||
proximity_devices = config.get(CONF_DEVICES)
|
proximity_devices: list[str] = config[CONF_DEVICES]
|
||||||
tolerance = config.get(CONF_TOLERANCE)
|
tolerance: int = config[CONF_TOLERANCE]
|
||||||
proximity_zone = name
|
proximity_zone = name
|
||||||
unit_of_measurement = config.get(
|
unit_of_measurement: str = config.get(
|
||||||
CONF_UNIT_OF_MEASUREMENT, hass.config.units.length_unit
|
CONF_UNIT_OF_MEASUREMENT, hass.config.units.length_unit
|
||||||
)
|
)
|
||||||
zone_id = f"zone.{config.get(CONF_ZONE)}"
|
zone_id = f"zone.{config[CONF_ZONE]}"
|
||||||
|
|
||||||
proximity = Proximity( # type:ignore[no-untyped-call]
|
proximity = Proximity( # type:ignore[no-untyped-call]
|
||||||
hass,
|
hass,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user