mirror of
https://github.com/home-assistant/core.git
synced 2026-05-05 12:24:48 +02:00
6988e73ddc
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
29 lines
971 B
Python
29 lines
971 B
Python
"""Base entity for Arcam FMJ integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from homeassistant.helpers.entity import EntityDescription
|
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
|
|
|
from .coordinator import ArcamFmjCoordinator
|
|
|
|
|
|
class ArcamFmjEntity(CoordinatorEntity[ArcamFmjCoordinator]):
|
|
"""Base entity for Arcam FMJ."""
|
|
|
|
_attr_has_entity_name = True
|
|
|
|
def __init__(
|
|
self,
|
|
coordinator: ArcamFmjCoordinator,
|
|
description: EntityDescription | None = None,
|
|
) -> None:
|
|
"""Initialize the entity."""
|
|
super().__init__(coordinator)
|
|
self._attr_device_info = coordinator.device_info
|
|
self._attr_entity_registry_enabled_default = coordinator.state.zn == 1
|
|
self._attr_unique_id = coordinator.zone_unique_id
|
|
if description is not None:
|
|
self._attr_unique_id = f"{self._attr_unique_id}-{description.key}"
|
|
self.entity_description = description
|