mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Use DeviceInfo in upb (#58621)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
6391376d6f
commit
d214bfec47
@ -4,7 +4,7 @@ import upb_lib
|
|||||||
|
|
||||||
from homeassistant.const import ATTR_COMMAND, CONF_FILE_PATH, CONF_HOST
|
from homeassistant.const import ATTR_COMMAND, CONF_FILE_PATH, CONF_HOST
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_ADDRESS,
|
ATTR_ADDRESS,
|
||||||
@ -119,12 +119,12 @@ class UpbAttachedEntity(UpbEntity):
|
|||||||
"""Base class for UPB attached entities."""
|
"""Base class for UPB attached entities."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self):
|
def device_info(self) -> DeviceInfo:
|
||||||
"""Device info for the entity."""
|
"""Device info for the entity."""
|
||||||
return {
|
return DeviceInfo(
|
||||||
"name": self._element.name,
|
identifiers={(DOMAIN, self._element.index)},
|
||||||
"identifiers": {(DOMAIN, self._element.index)},
|
manufacturer=self._element.manufacturer,
|
||||||
"sw_version": self._element.version,
|
model=self._element.product,
|
||||||
"manufacturer": self._element.manufacturer,
|
name=self._element.name,
|
||||||
"model": self._element.product,
|
sw_version=self._element.version,
|
||||||
}
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user