Files
epenetGitHubcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>frenck
d766aae436 Remove import annotations from components (#169536)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
2026-04-30 21:14:48 +02:00

30 lines
978 B
Python

"""Base entity for OpenDisplay devices."""
from homeassistant.components.bluetooth.passive_update_coordinator import (
PassiveBluetoothCoordinatorEntity,
)
from homeassistant.helpers.device_registry import CONNECTION_BLUETOOTH, DeviceInfo
from homeassistant.helpers.entity import EntityDescription
from .coordinator import OpenDisplayCoordinator
class OpenDisplayEntity(PassiveBluetoothCoordinatorEntity[OpenDisplayCoordinator]):
"""Base class for all OpenDisplay entities."""
_attr_has_entity_name = True
def __init__(
self,
coordinator: OpenDisplayCoordinator,
description: EntityDescription,
) -> None:
"""Initialize the entity."""
super().__init__(coordinator)
self.entity_description = description
self._attr_unique_id = f"{coordinator.address}-{description.key}"
self._attr_device_info = DeviceInfo(
connections={(CONNECTION_BLUETOOTH, coordinator.address)},
)