mirror of
https://github.com/home-assistant/core.git
synced 2026-07-01 19:57:08 +01:00
d766aae436
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
28 lines
881 B
Python
28 lines
881 B
Python
"""Base entity for the LOQED integration."""
|
|
|
|
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
|
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
|
|
|
from .const import DOMAIN
|
|
from .coordinator import LoqedDataCoordinator
|
|
|
|
|
|
class LoqedEntity(CoordinatorEntity[LoqedDataCoordinator]):
|
|
"""Defines a LOQED entity."""
|
|
|
|
_attr_has_entity_name = True
|
|
|
|
def __init__(self, coordinator: LoqedDataCoordinator) -> None:
|
|
"""Initialize the LOQED entity."""
|
|
super().__init__(coordinator=coordinator)
|
|
|
|
lock_id = coordinator.lock.id
|
|
|
|
self._attr_device_info = DeviceInfo(
|
|
identifiers={(DOMAIN, lock_id)},
|
|
manufacturer="LOQED",
|
|
name=coordinator.device_name,
|
|
model="Touch Smart Lock",
|
|
connections={(CONNECTION_NETWORK_MAC, lock_id)},
|
|
)
|