1 """Support for the ZHA platform."""
3 from __future__
import annotations
15 from .entity
import ZHAEntity
16 from .helpers
import (
18 async_add_entities
as zha_async_add_entities,
25 config_entry: ConfigEntry,
26 async_add_entities: AddEntitiesCallback,
28 """Set up the Zigbee Home Automation device tracker from config entry."""
30 entities_to_create = zha_data.platforms[Platform.DEVICE_TRACKER]
36 zha_async_add_entities,
38 ZHADeviceScannerEntity,
42 config_entry.async_on_unload(unsub)
46 """Represent a tracked device."""
48 _attr_should_poll =
True
49 _attr_name: str =
"Device scanner"
53 """Return true if the device is connected to the network."""
54 return self.entity_data.entity.is_connected
58 """Return the battery level of the device.
60 Percentage from 0-100.
62 return self.entity_data.entity.battery_level
66 """Return device info."""
69 return ZHAEntity.device_info.__get__(self)
73 """Return unique ID."""
75 return ZHAEntity.unique_id.__get__(self)
int|None battery_level(self)
DeviceInfo device_info(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
HAZHAData get_zha_data(HomeAssistant hass)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)