mirror of https://github.com/home-assistant/core
26 lines
820 B
Python
26 lines
820 B
Python
"""The PrusaLink integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from homeassistant.helpers.device_registry import DeviceInfo
|
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
|
|
|
from .const import DOMAIN
|
|
from .coordinator import PrusaLinkUpdateCoordinator
|
|
|
|
|
|
class PrusaLinkEntity(CoordinatorEntity[PrusaLinkUpdateCoordinator]):
|
|
"""Defines a base PrusaLink entity."""
|
|
|
|
_attr_has_entity_name = True
|
|
|
|
@property
|
|
def device_info(self) -> DeviceInfo:
|
|
"""Return device information about this PrusaLink device."""
|
|
return DeviceInfo(
|
|
identifiers={(DOMAIN, self.coordinator.config_entry.entry_id)},
|
|
name=self.coordinator.config_entry.title,
|
|
manufacturer="Prusa",
|
|
configuration_url=self.coordinator.api.client.host,
|
|
)
|