1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00
Files
core/homeassistant/components/jvc_projector/entity.py
T
2026-01-29 12:45:19 +01:00

43 lines
1.2 KiB
Python

"""Base Entity for the jvc_projector integration."""
from __future__ import annotations
import logging
from jvcprojector import Command, JvcProjector
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN, MANUFACTURER, NAME
from .coordinator import JvcProjectorDataUpdateCoordinator
_LOGGER = logging.getLogger(__name__)
class JvcProjectorEntity(CoordinatorEntity[JvcProjectorDataUpdateCoordinator]):
"""Defines a base JVC Projector entity."""
_attr_has_entity_name = True
def __init__(
self,
coordinator: JvcProjectorDataUpdateCoordinator,
command: type[Command] | None = None,
) -> None:
"""Initialize the entity."""
super().__init__(coordinator, command)
self._attr_unique_id = coordinator.unique_id
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._attr_unique_id)},
name=NAME,
model=self.device.model,
manufacturer=MANUFACTURER,
)
@property
def device(self) -> JvcProjector:
"""Return the device representing the projector."""
return self.coordinator.device