core/homeassistant/components/nyt_games/entity.py

24 lines
774 B
Python
Raw Normal View History

"""Base class for NYT Games entities."""
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import NYTGamesCoordinator
class NYTGamesEntity(CoordinatorEntity[NYTGamesCoordinator]):
"""Defines a base NYT Games entity."""
_attr_has_entity_name = True
def __init__(self, coordinator: NYTGamesCoordinator) -> None:
"""Initialize a NYT Games entity."""
super().__init__(coordinator)
2024-09-23 17:28:30 +00:00
unique_id = coordinator.config_entry.unique_id
assert unique_id is not None
self._attr_device_info = DeviceInfo(
2024-09-23 17:28:30 +00:00
identifiers={(DOMAIN, unique_id)},
manufacturer="New York Times",
)