Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """Base Entity for Zeversolar sensors."""
2 
3 from __future__ import annotations
4 
5 from homeassistant.helpers.device_registry import DeviceInfo
6 from homeassistant.helpers.update_coordinator import CoordinatorEntity
7 
8 from .const import DOMAIN
9 from .coordinator import ZeversolarCoordinator
10 
11 
13  CoordinatorEntity[ZeversolarCoordinator],
14 ):
15  """Defines a base Zeversolar entity."""
16 
17  _attr_has_entity_name = True
18 
19  def __init__(
20  self,
21  *,
22  coordinator: ZeversolarCoordinator,
23  ) -> None:
24  """Initialize the Zeversolar entity."""
25  super().__init__(coordinator=coordinator)
26  self._attr_device_info_attr_device_info = DeviceInfo(
27  identifiers={(DOMAIN, coordinator.data.serial_number)},
28  name="Zeversolar Sensor",
29  manufacturer="Zeversolar",
30  )
None __init__(self, *ZeversolarCoordinator coordinator)
Definition: entity.py:23