mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Migrate Litterrobot to new entity naming style (#77484)
* Migrate Litterrobot to new entity naming style * uno mas
This commit is contained in:
parent
640d8b40f0
commit
b0a05530b0
@ -31,17 +31,15 @@ REFRESH_WAIT_TIME_SECONDS = 8
|
|||||||
class LitterRobotEntity(CoordinatorEntity[DataUpdateCoordinator[bool]]):
|
class LitterRobotEntity(CoordinatorEntity[DataUpdateCoordinator[bool]]):
|
||||||
"""Generic Litter-Robot entity representing common data and methods."""
|
"""Generic Litter-Robot entity representing common data and methods."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(self, robot: Robot, entity_type: str, hub: LitterRobotHub) -> None:
|
def __init__(self, robot: Robot, entity_type: str, hub: LitterRobotHub) -> None:
|
||||||
"""Pass coordinator to CoordinatorEntity."""
|
"""Pass coordinator to CoordinatorEntity."""
|
||||||
super().__init__(hub.coordinator)
|
super().__init__(hub.coordinator)
|
||||||
self.robot = robot
|
self.robot = robot
|
||||||
self.entity_type = entity_type
|
self.entity_type = entity_type
|
||||||
self.hub = hub
|
self.hub = hub
|
||||||
|
self._attr_name = entity_type.capitalize()
|
||||||
@property
|
|
||||||
def name(self) -> str:
|
|
||||||
"""Return the name of this entity."""
|
|
||||||
return f"{self.robot.name} {self.entity_type}"
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user