Skip to content

Commit

Permalink
Fix last test
Browse files Browse the repository at this point in the history
  • Loading branch information
gjohansson-ST committed Oct 13, 2024
1 parent bd3eef9 commit bd7cc34
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/components/litterrobot/test_vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
DOMAIN as PLATFORM_DOMAIN,
SERVICE_START,
SERVICE_STOP,
STATE_DOCKED,
STATE_ERROR,
STATE_PAUSED,
VacuumEntityState,
)
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -53,7 +51,7 @@ async def test_vacuum(

vacuum = hass.states.get(VACUUM_ENTITY_ID)
assert vacuum
assert vacuum.state == STATE_DOCKED
assert vacuum.state == VacuumEntityState.DOCKED
assert vacuum.attributes["is_sleeping"] is False

ent_reg_entry = entity_registry.async_get(VACUUM_ENTITY_ID)
Expand Down Expand Up @@ -95,15 +93,18 @@ async def test_vacuum_with_error(

vacuum = hass.states.get(VACUUM_ENTITY_ID)
assert vacuum
assert vacuum.state == STATE_ERROR
assert vacuum.state == VacuumEntityState.ERROR


@pytest.mark.parametrize(
("robot_data", "expected_state"),
[
({"displayCode": "DC_CAT_DETECT"}, STATE_DOCKED),
({"isDFIFull": True}, STATE_ERROR),
({"robotCycleState": "CYCLE_STATE_CAT_DETECT"}, STATE_PAUSED),
({"displayCode": "DC_CAT_DETECT"}, VacuumEntityState.DOCKED),
({"isDFIFull": True}, VacuumEntityState.ERROR),
(
{"robotCycleState": "CYCLE_VacuumEntityState.CAT_DETECT"},
VacuumEntityState.PAUSED,
),
],
)
async def test_vacuum_states(
Expand Down Expand Up @@ -150,7 +151,7 @@ async def test_commands(

vacuum = hass.states.get(VACUUM_ENTITY_ID)
assert vacuum
assert vacuum.state == STATE_DOCKED
assert vacuum.state == VacuumEntityState.DOCKED

extra = extra or {}
data = {ATTR_ENTITY_ID: VACUUM_ENTITY_ID, **extra.get("data", {})}
Expand Down

0 comments on commit bd7cc34

Please sign in to comment.