Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """PermobilEntity class."""
2 
3 from homeassistant.helpers.device_registry import DeviceInfo
4 from homeassistant.helpers.entity import EntityDescription
5 from homeassistant.helpers.update_coordinator import CoordinatorEntity
6 
7 from .const import DOMAIN
8 from .coordinator import MyPermobilCoordinator
9 
10 
11 class PermobilEntity(CoordinatorEntity[MyPermobilCoordinator]):
12  """Representation of a permobil Entity."""
13 
14  _attr_has_entity_name = True
15 
16  def __init__(
17  self,
18  coordinator: MyPermobilCoordinator,
19  description: EntityDescription,
20  ) -> None:
21  """Initialize the entity."""
22  super().__init__(coordinator)
23  self.entity_descriptionentity_description = description
24  self._attr_unique_id_attr_unique_id = f"{coordinator.p_api.email}_{description.key}"
25  self._attr_device_info_attr_device_info = DeviceInfo(
26  identifiers={(DOMAIN, coordinator.p_api.email)},
27  manufacturer="Permobil",
28  name="Permobil Wheelchair",
29  )
None __init__(self, MyPermobilCoordinator coordinator, EntityDescription description)
Definition: entity.py:20