Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """Platform for shared base classes for sensors."""
2 
3 from __future__ import annotations
4 
5 from homeassistant.helpers.entity import EntityDescription
6 from homeassistant.helpers.update_coordinator import CoordinatorEntity
7 
8 from . import IntellifireDataUpdateCoordinator
9 
10 
11 class IntellifireEntity(CoordinatorEntity[IntellifireDataUpdateCoordinator]):
12  """Define a generic class for IntelliFire entities."""
13 
14  _attr_attribution = "Data provided by unpublished Intellifire API"
15  _attr_has_entity_name = True
16 
17  def __init__(
18  self,
19  coordinator: IntellifireDataUpdateCoordinator,
20  description: EntityDescription,
21  ) -> None:
22  """Class initializer."""
23  super().__init__(coordinator=coordinator)
24  self.entity_descriptionentity_description = description
25  self._attr_unique_id_attr_unique_id = f"{description.key}_{coordinator.fireplace.serial}"
26  self.identifiersidentifiers = ({("IntelliFire", f"{coordinator.fireplace.serial}]")},)
27 
28  # Configure the Device Info
29  self._attr_device_info_attr_device_info = self.coordinator.device_info
None __init__(self, IntellifireDataUpdateCoordinator coordinator, EntityDescription description)
Definition: entity.py:21