Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """Base Entity for the jvc_projector integration."""
2 
3 from __future__ import annotations
4 
5 import logging
6 
7 from jvcprojector import JvcProjector
8 
9 from homeassistant.helpers.device_registry import DeviceInfo
10 from homeassistant.helpers.update_coordinator import CoordinatorEntity
11 
12 from .const import DOMAIN, MANUFACTURER, NAME
13 from .coordinator import JvcProjectorDataUpdateCoordinator
14 
15 _LOGGER = logging.getLogger(__name__)
16 
17 
18 class JvcProjectorEntity(CoordinatorEntity[JvcProjectorDataUpdateCoordinator]):
19  """Defines a base JVC Projector entity."""
20 
21  _attr_has_entity_name = True
22 
23  def __init__(self, coordinator: JvcProjectorDataUpdateCoordinator) -> None:
24  """Initialize the entity."""
25  super().__init__(coordinator)
26 
27  self._attr_unique_id_attr_unique_id = coordinator.unique_id
28  self._attr_device_info_attr_device_info = DeviceInfo(
29  identifiers={(DOMAIN, coordinator.unique_id)},
30  name=NAME,
31  model=self.devicedevicedevice.model,
32  manufacturer=MANUFACTURER,
33  )
34 
35  @property
36  def device(self) -> JvcProjector:
37  """Return the device representing the projector."""
38  return self.coordinator.device
None __init__(self, JvcProjectorDataUpdateCoordinator coordinator)
Definition: entity.py:23