Add short-hand attributes to vacuum (#81782)

Add attributes to vacuum
This commit is contained in:
epenet 2022-11-08 13:58:47 +01:00 committed by GitHub
parent 4293c88fb6
commit 9b0b8ae9c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,11 +318,12 @@ class VacuumEntity(_BaseVacuum, ToggleEntity):
"""Representation of a vacuum cleaner robot.""" """Representation of a vacuum cleaner robot."""
entity_description: VacuumEntityDescription entity_description: VacuumEntityDescription
_attr_status: str | None = None
@property @property
def status(self) -> str | None: def status(self) -> str | None:
"""Return the status of the vacuum cleaner.""" """Return the status of the vacuum cleaner."""
return None return self._attr_status
@property @property
def battery_icon(self) -> str: def battery_icon(self) -> str:
@ -394,11 +395,12 @@ class StateVacuumEntity(_BaseVacuum):
"""Representation of a vacuum cleaner robot that supports states.""" """Representation of a vacuum cleaner robot that supports states."""
entity_description: StateVacuumEntityDescription entity_description: StateVacuumEntityDescription
_attr_state: str | None = None
@property @property
def state(self) -> str | None: def state(self) -> str | None:
"""Return the state of the vacuum cleaner.""" """Return the state of the vacuum cleaner."""
return None return self._attr_state
@property @property
def battery_icon(self) -> str: def battery_icon(self) -> str: