* add config flow * fix tests * adjust and fix tests * fix tests * config_zones as fixture * add config flow tests * use coordinator.async_config_entry_first_refresh * use entry.entry_id for hass.data * fix doc string * remove unused unit_of_measurement string key * don't store friendly_name, just use self.name * abort on matching entiry * break out legacy setup into seperate function * make tracked entites required * move _asnyc_setup_legacy to module level * use zone name as config entry title * add entity_used_in helper * check entry source if imported * create repair issue for removed tracked entities * separate state change from registry change event handling * migrate unique ids after tracked entity renamed * use full words for the variable names * use defaultdict * add test * remove unnecessary if not in check * use unique_id of tracked entity * use the entity registry entry id * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
31 lines
789 B
Python
31 lines
789 B
Python
"""Constants for Proximity integration."""
|
|
|
|
from typing import Final
|
|
|
|
from homeassistant.const import UnitOfLength
|
|
|
|
ATTR_DIR_OF_TRAVEL: Final = "dir_of_travel"
|
|
ATTR_DIST_TO: Final = "dist_to_zone"
|
|
ATTR_ENTITIES_DATA: Final = "entities_data"
|
|
ATTR_IN_IGNORED_ZONE: Final = "is_in_ignored_zone"
|
|
ATTR_NEAREST: Final = "nearest"
|
|
ATTR_PROXIMITY_DATA: Final = "proximity_data"
|
|
|
|
CONF_IGNORED_ZONES = "ignored_zones"
|
|
CONF_TOLERANCE = "tolerance"
|
|
CONF_TRACKED_ENTITIES = "tracked_entities"
|
|
|
|
DEFAULT_DIR_OF_TRAVEL = "not set"
|
|
DEFAULT_DIST_TO_ZONE = "not set"
|
|
DEFAULT_NEAREST = "not set"
|
|
DEFAULT_PROXIMITY_ZONE = "home"
|
|
DEFAULT_TOLERANCE = 1
|
|
DOMAIN = "proximity"
|
|
|
|
UNITS = [
|
|
UnitOfLength.METERS,
|
|
UnitOfLength.KILOMETERS,
|
|
UnitOfLength.FEET,
|
|
UnitOfLength.YARDS,
|
|
UnitOfLength.MILES,
|
|
]
|