Use shorthand attributes in Tp-link Omada (#99889)

This commit is contained in:
Joost Lekkerkerker 2023-09-08 01:07:15 +02:00 committed by GitHub
parent 5a66aac330
commit c2b119bfaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,14 +20,10 @@ class OmadaDeviceEntity(CoordinatorEntity[OmadaCoordinator[T]], Generic[T]):
"""Initialize the device."""
super().__init__(coordinator)
self.device = device
@property
def device_info(self) -> DeviceInfo:
"""Return information about the device."""
return DeviceInfo(
connections={(dr.CONNECTION_NETWORK_MAC, self.device.mac)},
identifiers={(DOMAIN, (self.device.mac))},
self._attr_device_info = DeviceInfo(
connections={(dr.CONNECTION_NETWORK_MAC, device.mac)},
identifiers={(DOMAIN, device.mac)},
manufacturer="TP-Link",
model=self.device.model_display_name,
name=self.device.name,
model=device.model_display_name,
name=device.name,
)