Add device info to Surepetcare (#56600)
This commit is contained in:
parent
64393b462d
commit
aca00667df
1 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,7 @@ from homeassistant.core import callback
|
|||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
from . import SurePetcareDataCoordinator
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
class SurePetcareEntity(CoordinatorEntity):
|
||||
|
@ -32,6 +33,12 @@ class SurePetcareEntity(CoordinatorEntity):
|
|||
self._device_name = surepy_entity.type.name.capitalize().replace("_", " ")
|
||||
|
||||
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])
|
||||
|
||||
@abstractmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue