Use DeviceInfo in subaru (#58577)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-10-28 18:19:46 +02:00 committed by GitHub
parent 11661454ac
commit 6cfa5b2a28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
"""Base class for all Subaru Entities.""" """Base class for all Subaru Entities."""
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN, MANUFACTURER, VEHICLE_NAME, VEHICLE_VIN from .const import DOMAIN, MANUFACTURER, VEHICLE_NAME, VEHICLE_VIN
@ -25,10 +26,10 @@ class SubaruEntity(CoordinatorEntity):
return f"{self.vin}_{self.entity_type}" return f"{self.vin}_{self.entity_type}"
@property @property
def device_info(self): def device_info(self) -> DeviceInfo:
"""Return the device_info of the device.""" """Return the device_info of the device."""
return { return DeviceInfo(
"identifiers": {(DOMAIN, self.vin)}, identifiers={(DOMAIN, self.vin)},
"name": self.car_name, manufacturer=MANUFACTURER,
"manufacturer": MANUFACTURER, name=self.car_name,
} )