Use DeviceInfo in tplink (#58606)

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/58628/head
epenet 2021-10-28 18:23:16 +02:00 committed by GitHub
parent a0b3a58d1c
commit 2dcb429c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -48,14 +48,14 @@ class CoordinatedTPLinkEntity(CoordinatorEntity):
@property @property
def device_info(self) -> DeviceInfo: def device_info(self) -> DeviceInfo:
"""Return information about the device.""" """Return information about the device."""
return { return DeviceInfo(
"name": self.device.alias, connections={(dr.CONNECTION_NETWORK_MAC, self.device.mac)},
"model": self.device.model, identifiers={(DOMAIN, str(self.device.device_id))},
"manufacturer": "TP-Link", manufacturer="TP-Link",
"identifiers": {(DOMAIN, str(self.device.device_id))}, model=self.device.model,
"connections": {(dr.CONNECTION_NETWORK_MAC, self.device.mac)}, name=self.device.alias,
"sw_version": self.device.hw_info["sw_ver"], sw_version=self.device.hw_info["sw_ver"],
} )
@property @property
def is_on(self) -> bool: def is_on(self) -> bool: