2024-09-23 15:40:19 +00:00
|
|
|
"""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
|
2024-09-23 15:40:19 +00:00
|
|
|
self._attr_device_info = DeviceInfo(
|
2024-09-23 17:28:30 +00:00
|
|
|
identifiers={(DOMAIN, unique_id)},
|
2024-09-23 15:40:19 +00:00
|
|
|
manufacturer="New York Times",
|
|
|
|
)
|