mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add device info to Surepetcare (#56600)
This commit is contained in:
parent
64393b462d
commit
aca00667df
@ -9,6 +9,7 @@ from homeassistant.core import callback
|
|||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from . import SurePetcareDataCoordinator
|
from . import SurePetcareDataCoordinator
|
||||||
|
from .const import DOMAIN
|
||||||
|
|
||||||
|
|
||||||
class SurePetcareEntity(CoordinatorEntity):
|
class SurePetcareEntity(CoordinatorEntity):
|
||||||
@ -32,6 +33,12 @@ class SurePetcareEntity(CoordinatorEntity):
|
|||||||
self._device_name = surepy_entity.type.name.capitalize().replace("_", " ")
|
self._device_name = surepy_entity.type.name.capitalize().replace("_", " ")
|
||||||
|
|
||||||
self._device_id = f"{surepy_entity.household_id}-{surepetcare_id}"
|
self._device_id = f"{surepy_entity.household_id}-{surepetcare_id}"
|
||||||
|
self._attr_device_info = {
|
||||||
|
"identifiers": {(DOMAIN, self._device_id)},
|
||||||
|
"name": self._device_name,
|
||||||
|
"manufacturer": "Sure Petcare",
|
||||||
|
"model": surepy_entity.type.name.capitalize().replace("_", " "),
|
||||||
|
}
|
||||||
self._update_attr(coordinator.data[surepetcare_id])
|
self._update_attr(coordinator.data[surepetcare_id])
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user