Add set_wait_time command support to Litter-Robot (#48300)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
30618aae94
commit
eb2949a20f
19 changed files with 487 additions and 250 deletions
|
@ -5,12 +5,18 @@ from pylitterbot.exceptions import LitterRobotException, LitterRobotLoginExcepti
|
|||
import pytest
|
||||
|
||||
from homeassistant.components import litterrobot
|
||||
from homeassistant.components.vacuum import (
|
||||
DOMAIN as VACUUM_DOMAIN,
|
||||
SERVICE_START,
|
||||
STATE_DOCKED,
|
||||
)
|
||||
from homeassistant.config_entries import (
|
||||
ENTRY_STATE_SETUP_ERROR,
|
||||
ENTRY_STATE_SETUP_RETRY,
|
||||
)
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
|
||||
from .common import CONFIG
|
||||
from .common import CONFIG, VACUUM_ENTITY_ID
|
||||
from .conftest import setup_integration
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
@ -18,7 +24,19 @@ from tests.common import MockConfigEntry
|
|||
|
||||
async def test_unload_entry(hass, mock_account):
|
||||
"""Test being able to unload an entry."""
|
||||
entry = await setup_integration(hass, mock_account)
|
||||
entry = await setup_integration(hass, mock_account, VACUUM_DOMAIN)
|
||||
|
||||
vacuum = hass.states.get(VACUUM_ENTITY_ID)
|
||||
assert vacuum
|
||||
assert vacuum.state == STATE_DOCKED
|
||||
|
||||
await hass.services.async_call(
|
||||
VACUUM_DOMAIN,
|
||||
SERVICE_START,
|
||||
{ATTR_ENTITY_ID: VACUUM_ENTITY_ID},
|
||||
blocking=True,
|
||||
)
|
||||
getattr(mock_account.robots[0], "start_cleaning").assert_called_once()
|
||||
|
||||
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue