Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra_state_attributes from Litter-Robot vacuum entities #136196

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions homeassistant/components/litterrobot/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ def activity(self) -> VacuumActivity:
"""Return the state of the cleaner."""
return LITTER_BOX_STATUS_STATE_MAP.get(self.robot.status, VacuumActivity.ERROR)

@property
def status(self) -> str:
"""Return the status of the cleaner."""
return (
f"{self.robot.status.text}{' (Sleeping)' if self.robot.is_sleeping else ''}"
)

async def async_start(self) -> None:
"""Start a clean cycle."""
await self.robot.set_power_status(True)
Expand Down Expand Up @@ -121,13 +114,3 @@ def parse_time_at_default_timezone(time_str: str | None) -> time | None:
)
.timetz()
)

@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return device specific state attributes."""
return {
"is_sleeping": self.robot.is_sleeping,
"sleep_mode_enabled": self.robot.sleep_mode_enabled,
"power_status": self.robot.power_status,
"status": self.status,
}
13 changes: 0 additions & 13 deletions tests/components/litterrobot/test_vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from homeassistant.components.litterrobot import DOMAIN
from homeassistant.components.litterrobot.vacuum import SERVICE_SET_SLEEP_MODE
from homeassistant.components.vacuum import (
ATTR_STATUS,
DOMAIN as PLATFORM_DOMAIN,
SERVICE_START,
SERVICE_STOP,
Expand Down Expand Up @@ -52,23 +51,11 @@ async def test_vacuum(
vacuum = hass.states.get(VACUUM_ENTITY_ID)
assert vacuum
assert vacuum.state == VacuumActivity.DOCKED
assert vacuum.attributes["is_sleeping"] is False

ent_reg_entry = entity_registry.async_get(VACUUM_ENTITY_ID)
assert ent_reg_entry.unique_id == VACUUM_UNIQUE_ID


async def test_vacuum_status_when_sleeping(
hass: HomeAssistant, mock_account_with_sleeping_robot: MagicMock
) -> None:
"""Tests the vacuum status when sleeping."""
await setup_integration(hass, mock_account_with_sleeping_robot, PLATFORM_DOMAIN)

vacuum = hass.states.get(VACUUM_ENTITY_ID)
assert vacuum
assert vacuum.attributes.get(ATTR_STATUS) == "Ready (Sleeping)"


async def test_no_robots(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
Expand Down