mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add volvo on call device_info to group entities in one device per vehicle (#79329)
This commit is contained in:
parent
faef09d3d7
commit
849688f71f
@ -23,6 +23,7 @@ from homeassistant.exceptions import ConfigEntryAuthFailed
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
from homeassistant.helpers.update_coordinator import (
|
||||
@ -314,6 +315,16 @@ class VolvoEntity(CoordinatorEntity):
|
||||
"""Return true if unable to access real state of entity."""
|
||||
return True
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return a inique set of attributes for each vehicle."""
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self.vehicle.vin)},
|
||||
name=self._vehicle_name,
|
||||
model=self.vehicle.vehicle_type,
|
||||
manufacturer="Volvo",
|
||||
)
|
||||
|
||||
@property
|
||||
def extra_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user