Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """The tankerkoenig base entity."""
2 
3 from aiotankerkoenig import Station
4 
5 from homeassistant.const import ATTR_ID
6 from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
7 from homeassistant.helpers.update_coordinator import CoordinatorEntity
8 
9 from .coordinator import TankerkoenigDataUpdateCoordinator
10 
11 
13  CoordinatorEntity[TankerkoenigDataUpdateCoordinator]
14 ):
15  """Tankerkoenig base entity."""
16 
17  _attr_has_entity_name = True
18 
19  def __init__(
20  self, coordinator: TankerkoenigDataUpdateCoordinator, station: Station
21  ) -> None:
22  """Initialize the Tankerkoenig base entity."""
23  super().__init__(coordinator)
24  self._attr_device_info_attr_device_info = DeviceInfo(
25  identifiers={(ATTR_ID, station.id)},
26  name=f"{station.brand} {station.street} {station.house_number}",
27  model=station.brand,
28  configuration_url="https://www.tankerkoenig.de",
29  entry_type=DeviceEntryType.SERVICE,
30  )
None __init__(self, TankerkoenigDataUpdateCoordinator coordinator, Station station)
Definition: entity.py:21