Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """Base entity for Weheat."""
2 
3 from homeassistant.helpers.device_registry import DeviceInfo
4 from homeassistant.helpers.update_coordinator import CoordinatorEntity
5 
6 from .const import DOMAIN, MANUFACTURER
7 from .coordinator import WeheatDataUpdateCoordinator
8 
9 
10 class WeheatEntity(CoordinatorEntity[WeheatDataUpdateCoordinator]):
11  """Defines a base Weheat entity."""
12 
13  _attr_has_entity_name = True
14 
15  def __init__(
16  self,
17  coordinator: WeheatDataUpdateCoordinator,
18  ) -> None:
19  """Initialize the Weheat entity."""
20  super().__init__(coordinator)
21 
22  self._attr_device_info_attr_device_info = DeviceInfo(
23  identifiers={(DOMAIN, coordinator.heatpump_id)},
24  name=coordinator.readable_name,
25  manufacturer=MANUFACTURER,
26  model=coordinator.model,
27  )
None __init__(self, WeheatDataUpdateCoordinator coordinator)
Definition: entity.py:18