Use DeviceInfo on components with via_device (R-X) (#58213)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
176ed4f7ba
commit
a3d1159a13
12 changed files with 126 additions and 125 deletions
|
@ -1,5 +1,5 @@
|
|||
"""Base class for Tado entity."""
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||
|
||||
from .const import DEFAULT_NAME, DOMAIN, TADO_HOME, TADO_ZONE
|
||||
|
||||
|
@ -15,16 +15,16 @@ class TadoDeviceEntity(Entity):
|
|||
self.device_id = device_info["shortSerialNo"]
|
||||
|
||||
@property
|
||||
def device_info(self):
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return the device_info of the device."""
|
||||
return {
|
||||
"identifiers": {(DOMAIN, self.device_id)},
|
||||
"name": self.device_name,
|
||||
"manufacturer": DEFAULT_NAME,
|
||||
"sw_version": self._device_info["currentFwVersion"],
|
||||
"model": self._device_info["deviceType"],
|
||||
"via_device": (DOMAIN, self._device_info["serialNo"]),
|
||||
}
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self.device_id)},
|
||||
name=self.device_name,
|
||||
manufacturer=DEFAULT_NAME,
|
||||
sw_version=self._device_info["currentFwVersion"],
|
||||
model=self._device_info["deviceType"],
|
||||
via_device=(DOMAIN, self._device_info["serialNo"]),
|
||||
)
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue