mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Adapt hortimax to set via_device_id in DeviceInfo (#178233)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user