From 0cf32e74d620d396e75c48dcaa16056da69d1621 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Fri, 8 Sep 2023 12:36:46 +0200 Subject: [PATCH] Use shorthand attributes in Tp-link (#99888) --- homeassistant/components/tplink/entity.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/tplink/entity.py b/homeassistant/components/tplink/entity.py index 890793b898d..afb341b47ed 100644 --- a/homeassistant/components/tplink/entity.py +++ b/homeassistant/components/tplink/entity.py @@ -41,18 +41,14 @@ class CoordinatedTPLinkEntity(CoordinatorEntity[TPLinkDataUpdateCoordinator]): super().__init__(coordinator) self.device: SmartDevice = device self._attr_unique_id = self.device.device_id - - @property - def device_info(self) -> DeviceInfo: - """Return information about the device.""" - return DeviceInfo( - connections={(dr.CONNECTION_NETWORK_MAC, self.device.mac)}, - identifiers={(DOMAIN, str(self.device.device_id))}, + self._attr_device_info = DeviceInfo( + connections={(dr.CONNECTION_NETWORK_MAC, device.mac)}, + identifiers={(DOMAIN, str(device.device_id))}, manufacturer="TP-Link", - model=self.device.model, - name=self.device.alias, - sw_version=self.device.hw_info["sw_ver"], - hw_version=self.device.hw_info["hw_ver"], + model=device.model, + name=device.alias, + sw_version=device.hw_info["sw_ver"], + hw_version=device.hw_info["hw_ver"], ) @property