1 """Provide functionality to keep track of devices."""
3 from __future__
import annotations
5 from functools
import partial
10 all_with_deprecated_constants,
11 check_if_deprecated_constant,
12 dir_with_deprecated_constants,
17 from .config_entry
import (
19 ScannerEntityDescription,
21 TrackerEntityDescription,
26 _DEPRECATED_SOURCE_TYPE_BLUETOOTH,
27 _DEPRECATED_SOURCE_TYPE_BLUETOOTH_LE,
28 _DEPRECATED_SOURCE_TYPE_GPS,
29 _DEPRECATED_SOURCE_TYPE_ROUTER,
40 CONF_NEW_DEVICE_DEFAULTS,
43 CONNECTED_DEVICE_REGISTERED,
44 DEFAULT_CONSIDER_HOME,
55 SERVICE_SEE_PAYLOAD_SCHEMA,
60 async_setup_integration
as async_setup_legacy_integration,
66 def is_on(hass: HomeAssistant, entity_id: str) -> bool:
67 """Return the state if any or a specified device is home."""
68 return hass.states.is_state(entity_id, STATE_HOME)
71 async
def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
72 """Set up the device tracker."""
73 async_setup_legacy_integration(hass, config)
80 __getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
82 dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
bool async_setup(HomeAssistant hass, ConfigType config)
bool is_on(HomeAssistant hass, str entity_id)
list[str] all_with_deprecated_constants(dict[str, Any] module_globals)