Adapt hortimax to set via_device_id in DeviceInfo (#178233)

This commit is contained in:
Erik Montnemery
2026-08-05 15:07:42 +02:00
committed by GitHub
parent b78da24ea3
commit 6c55fcd3ee
+7 -2
View File
@@ -2,6 +2,7 @@
from aiohortos import Readout
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
@@ -13,7 +14,7 @@ class HortimaxEntity(CoordinatorEntity[HortimaxCoordinator]):
"""An entity backed by one readout of a HortOS source.
Sources (a weather station, a ventilation group, ...) each become their own
device, linked to their controller through ``via_device``.
device, linked to their controller through ``via_device_id``.
"""
_attr_has_entity_name = True
@@ -38,7 +39,11 @@ class HortimaxEntity(CoordinatorEntity[HortimaxCoordinator]):
),
model=source.type,
manufacturer=MANUFACTURER,
via_device=(DOMAIN, device_id),
via_device_id=dr.async_get_device_id_by_identifier(
coordinator.hass,
(DOMAIN, device_id),
config_entry_id=coordinator.config_entry.entry_id,
),
)
@property