Restructure and setup dedicated coordinator for Azure DevOps (#119199)
This commit is contained in:
parent
a0abd537c6
commit
c907912dd1
7 changed files with 208 additions and 95 deletions
28
homeassistant/components/azure_devops/entity.py
Normal file
28
homeassistant/components/azure_devops/entity.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
"""Base entity for Azure DevOps."""
|
||||
|
||||
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
from .const import DOMAIN
|
||||
from .coordinator import AzureDevOpsDataUpdateCoordinator
|
||||
|
||||
|
||||
class AzureDevOpsEntity(CoordinatorEntity[AzureDevOpsDataUpdateCoordinator]):
|
||||
"""Defines a base Azure DevOps entity."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
coordinator: AzureDevOpsDataUpdateCoordinator,
|
||||
) -> None:
|
||||
"""Initialize the Azure DevOps entity."""
|
||||
super().__init__(coordinator)
|
||||
self._attr_device_info = DeviceInfo(
|
||||
entry_type=DeviceEntryType.SERVICE,
|
||||
identifiers={
|
||||
(DOMAIN, coordinator.data.organization, coordinator.data.project.name) # type: ignore[arg-type]
|
||||
},
|
||||
manufacturer=coordinator.data.organization,
|
||||
name=coordinator.data.project.name,
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue