Home Assistant Unofficial Reference 2024.12.1
entity.py
Go to the documentation of this file.
1 """The NZBGet integration."""
2 
3 from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
4 from homeassistant.helpers.update_coordinator import CoordinatorEntity
5 
6 from .const import DOMAIN
7 from .coordinator import NZBGetDataUpdateCoordinator
8 
9 
10 class NZBGetEntity(CoordinatorEntity[NZBGetDataUpdateCoordinator]):
11  """Defines a base NZBGet entity."""
12 
13  _attr_has_entity_name = True
14 
15  def __init__(
16  self,
17  *,
18  entry_id: str,
19  entry_name: str,
20  coordinator: NZBGetDataUpdateCoordinator,
21  ) -> None:
22  """Initialize the NZBGet entity."""
23  super().__init__(coordinator)
24  self._entry_id_entry_id = entry_id
25  self._attr_device_info_attr_device_info = DeviceInfo(
26  identifiers={(DOMAIN, entry_id)},
27  name=entry_name,
28  entry_type=DeviceEntryType.SERVICE,
29  )
None __init__(self, *str entry_id, str entry_name, NZBGetDataUpdateCoordinator coordinator)
Definition: entity.py:21