mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Use DeviceInfo in youless (#58645)
This commit is contained in:
parent
16a3a9170e
commit
991c41532a
@ -21,6 +21,7 @@ from homeassistant.const import (
|
|||||||
VOLUME_CUBIC_METERS,
|
VOLUME_CUBIC_METERS,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import StateType
|
from homeassistant.helpers.typing import StateType
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
@ -71,12 +72,12 @@ class YoulessBaseSensor(CoordinatorEntity, SensorEntity):
|
|||||||
self._sensor_id = sensor_id
|
self._sensor_id = sensor_id
|
||||||
|
|
||||||
self._attr_unique_id = f"{DOMAIN}_{device}_{sensor_id}"
|
self._attr_unique_id = f"{DOMAIN}_{device}_{sensor_id}"
|
||||||
self._attr_device_info = {
|
self._attr_device_info = DeviceInfo(
|
||||||
"identifiers": {(DOMAIN, f"{device}_{device_group}")},
|
identifiers={(DOMAIN, f"{device}_{device_group}")},
|
||||||
"name": friendly_name,
|
manufacturer="YouLess",
|
||||||
"manufacturer": "YouLess",
|
model=self.coordinator.data.model,
|
||||||
"model": self.coordinator.data.model,
|
name=friendly_name,
|
||||||
}
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def get_sensor(self) -> YoulessSensor | None:
|
def get_sensor(self) -> YoulessSensor | None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user