mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Set Mac as connection to link HomeWizard devices on network (#101944)
This commit is contained in:
parent
8dd8af0718
commit
d0fb994199
@ -1,8 +1,8 @@
|
|||||||
"""Base entity for the HomeWizard integration."""
|
"""Base entity for the HomeWizard integration."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.const import ATTR_IDENTIFIERS
|
from homeassistant.const import ATTR_CONNECTIONS, ATTR_IDENTIFIERS
|
||||||
from homeassistant.helpers.device_registry import DeviceInfo
|
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
@ -25,6 +25,10 @@ class HomeWizardEntity(CoordinatorEntity[HWEnergyDeviceUpdateCoordinator]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if coordinator.data.device.serial is not None:
|
if coordinator.data.device.serial is not None:
|
||||||
|
self._attr_device_info[ATTR_CONNECTIONS] = {
|
||||||
|
(CONNECTION_NETWORK_MAC, coordinator.data.device.serial)
|
||||||
|
}
|
||||||
|
|
||||||
self._attr_device_info[ATTR_IDENTIFIERS] = {
|
self._attr_device_info[ATTR_IDENTIFIERS] = {
|
||||||
(DOMAIN, coordinator.data.device.serial)
|
(DOMAIN, coordinator.data.device.serial)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user