mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Small base entity cleanup for HomeWizard Energy entities (#102933)
This commit is contained in:
parent
100c3079ae
commit
923d2d0d81
@ -18,17 +18,13 @@ class HomeWizardEntity(CoordinatorEntity[HWEnergyDeviceUpdateCoordinator]):
|
|||||||
"""Initialize the HomeWizard entity."""
|
"""Initialize the HomeWizard entity."""
|
||||||
super().__init__(coordinator=coordinator)
|
super().__init__(coordinator=coordinator)
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
name=coordinator.entry.title,
|
|
||||||
manufacturer="HomeWizard",
|
manufacturer="HomeWizard",
|
||||||
sw_version=coordinator.data.device.firmware_version,
|
sw_version=coordinator.data.device.firmware_version,
|
||||||
model=coordinator.data.device.product_type,
|
model=coordinator.data.device.product_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
if coordinator.data.device.serial is not None:
|
if (serial_number := coordinator.data.device.serial) is not None:
|
||||||
self._attr_device_info[ATTR_CONNECTIONS] = {
|
self._attr_device_info[ATTR_CONNECTIONS] = {
|
||||||
(CONNECTION_NETWORK_MAC, coordinator.data.device.serial)
|
(CONNECTION_NETWORK_MAC, serial_number)
|
||||||
}
|
|
||||||
|
|
||||||
self._attr_device_info[ATTR_IDENTIFIERS] = {
|
|
||||||
(DOMAIN, coordinator.data.device.serial)
|
|
||||||
}
|
}
|
||||||
|
self._attr_device_info[ATTR_IDENTIFIERS] = {(DOMAIN, serial_number)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user