Small base entity cleanup for HomeWizard Energy entities ()

pull/102938/head^2
Franck Nijhof 2023-10-27 23:26:41 +02:00 committed by GitHub
parent 100c3079ae
commit 923d2d0d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions
homeassistant/components/homewizard

View File

@ -18,17 +18,13 @@ class HomeWizardEntity(CoordinatorEntity[HWEnergyDeviceUpdateCoordinator]):
"""Initialize the HomeWizard entity."""
super().__init__(coordinator=coordinator)
self._attr_device_info = DeviceInfo(
name=coordinator.entry.title,
manufacturer="HomeWizard",
sw_version=coordinator.data.device.firmware_version,
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] = {
(CONNECTION_NETWORK_MAC, coordinator.data.device.serial)
}
self._attr_device_info[ATTR_IDENTIFIERS] = {
(DOMAIN, coordinator.data.device.serial)
(CONNECTION_NETWORK_MAC, serial_number)
}
self._attr_device_info[ATTR_IDENTIFIERS] = {(DOMAIN, serial_number)}