Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.device_tracker.legacy Namespace Reference

Classes

class  AsyncSeeCallback
 
class  Device
 
class  DeviceScanner
 
class  DeviceTracker
 
class  DeviceTrackerPlatform
 
class  SeeCallback
 

Functions

None _async_setup_integration (HomeAssistant hass, ConfigType config, asyncio.Future[DeviceTracker] tracker_future)
 
tuple[dict[str, str|None], dict[str, dict[str, Any]]] _load_device_names_and_attributes (DeviceScanner scanner, bool device_name_uses_executor, bool extra_attributes_uses_executor, set[str] seen, list[str] found_devices)
 
DeviceTrackerPlatform|None async_create_platform_type (HomeAssistant hass, ConfigType config, str p_type, dict p_config)
 
list[DeviceTrackerPlatformasync_extract_config (HomeAssistant hass, ConfigType config)
 
list[Deviceasync_load_config (str path, HomeAssistant hass, timedelta consider_home)
 
None async_setup_integration (HomeAssistant hass, ConfigType config)
 
None async_setup_scanner_platform (HomeAssistant hass, ConfigType config, DeviceScanner scanner, Callable[..., Coroutine[None, None, None]] async_see_device, str platform)
 
str get_gravatar_for_email (str email)
 
DeviceTracker get_tracker (HomeAssistant hass, ConfigType config)
 
None remove_device_from_config (HomeAssistant hass, str device_id)
 
None see (HomeAssistant hass, str|None mac=None, str|None dev_id=None, str|None host_name=None, str|None location_name=None, GPSType|None gps=None, int|None gps_accuracy=None, int|None battery=None, dict[str, Any]|None attributes=None)
 
None update_config (str path, str dev_id, Device device)
 

Variables

 Final
 
 NEW_DEVICE_DEFAULTS_SCHEMA
 
list SOURCE_TYPES = [cls.value for cls in SourceType]
 

Detailed Description

Legacy device tracker classes.

Function Documentation

◆ _async_setup_integration()

None homeassistant.components.device_tracker.legacy._async_setup_integration ( HomeAssistant  hass,
ConfigType  config,
asyncio.Future[DeviceTracker tracker_future 
)
private
Set up the legacy integration.

Definition at line 237 of file legacy.py.

◆ _load_device_names_and_attributes()

tuple[dict[str, str | None], dict[str, dict[str, Any]]] homeassistant.components.device_tracker.legacy._load_device_names_and_attributes ( DeviceScanner  scanner,
bool  device_name_uses_executor,
bool  extra_attributes_uses_executor,
set[str]  seen,
list[str]  found_devices 
)
private
Load device names and attributes in a single executor job.

Definition at line 412 of file legacy.py.

◆ async_create_platform_type()

DeviceTrackerPlatform | None homeassistant.components.device_tracker.legacy.async_create_platform_type ( HomeAssistant  hass,
ConfigType  config,
str  p_type,
dict   p_config 
)
Determine type of platform.

Definition at line 400 of file legacy.py.

◆ async_extract_config()

list[DeviceTrackerPlatform] homeassistant.components.device_tracker.legacy.async_extract_config ( HomeAssistant  hass,
ConfigType   config 
)
Extract device tracker config and split between legacy and modern.

Definition at line 374 of file legacy.py.

◆ async_load_config()

list[Device] homeassistant.components.device_tracker.legacy.async_load_config ( str  path,
HomeAssistant  hass,
timedelta   consider_home 
)
Load devices from YAML configuration file.

This method is a coroutine.

Definition at line 1009 of file legacy.py.

◆ async_setup_integration()

None homeassistant.components.device_tracker.legacy.async_setup_integration ( HomeAssistant  hass,
ConfigType  config 
)
Set up the legacy integration.

Definition at line 205 of file legacy.py.

◆ async_setup_scanner_platform()

None homeassistant.components.device_tracker.legacy.async_setup_scanner_platform ( HomeAssistant  hass,
ConfigType  config,
DeviceScanner  scanner,
Callable[..., Coroutine[None, None, None]]  async_see_device,
str  platform 
)
Set up the connect scanner-based platform to device tracker.

This method must be run in the event loop.

Definition at line 434 of file legacy.py.

◆ get_gravatar_for_email()

str homeassistant.components.device_tracker.legacy.get_gravatar_for_email ( str  email)
Return an 80px Gravatar for the given email address.

Async friendly.

Definition at line 1084 of file legacy.py.

◆ get_tracker()

DeviceTracker homeassistant.components.device_tracker.legacy.get_tracker ( HomeAssistant  hass,
ConfigType  config 
)
Create a tracker.

Definition at line 546 of file legacy.py.

◆ remove_device_from_config()

None homeassistant.components.device_tracker.legacy.remove_device_from_config ( HomeAssistant  hass,
str  device_id 
)
Remove device from YAML configuration file.

Definition at line 1071 of file legacy.py.

◆ see()

None homeassistant.components.device_tracker.legacy.see ( HomeAssistant  hass,
str | None   mac = None,
str | None   dev_id = None,
str | None   host_name = None,
str | None   location_name = None,
GPSType | None   gps = None,
int | None   gps_accuracy = None,
int | None   battery = None,
dict[str, Any] | None   attributes = None 
)
Call service to notify you see device.

Definition at line 174 of file legacy.py.

◆ update_config()

None homeassistant.components.device_tracker.legacy.update_config ( str  path,
str  dev_id,
Device  device 
)
Add device to YAML configuration file.

Definition at line 1055 of file legacy.py.

Variable Documentation

◆ Final

homeassistant.components.device_tracker.legacy.Final

Definition at line 85 of file legacy.py.

◆ NEW_DEVICE_DEFAULTS_SCHEMA

homeassistant.components.device_tracker.legacy.NEW_DEVICE_DEFAULTS_SCHEMA
Initial value:
1 = vol.Any(
2  None,
3  vol.Schema({vol.Optional(CONF_TRACK_NEW, default=DEFAULT_TRACK_NEW): cv.boolean}),
4 )

Definition at line 89 of file legacy.py.

◆ SOURCE_TYPES

list homeassistant.components.device_tracker.legacy.SOURCE_TYPES = [cls.value for cls in SourceType]

Definition at line 87 of file legacy.py.