Bump pylitterbot to 2023.4.11 (#114918)
parent
d9573bb7dc
commit
6594d022ba
|
@ -12,5 +12,5 @@
|
|||
"integration_type": "hub",
|
||||
"iot_class": "cloud_push",
|
||||
"loggers": ["pylitterbot"],
|
||||
"requirements": ["pylitterbot==2023.4.9"]
|
||||
"requirements": ["pylitterbot==2023.4.11"]
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ LITTER_BOX_STATUS_STATE_MAP = {
|
|||
LitterBoxStatus.CLEAN_CYCLE: STATE_CLEANING,
|
||||
LitterBoxStatus.EMPTY_CYCLE: STATE_CLEANING,
|
||||
LitterBoxStatus.CLEAN_CYCLE_COMPLETE: STATE_DOCKED,
|
||||
LitterBoxStatus.CAT_DETECTED: STATE_DOCKED,
|
||||
LitterBoxStatus.CAT_SENSOR_TIMING: STATE_DOCKED,
|
||||
LitterBoxStatus.DRAWER_FULL_1: STATE_DOCKED,
|
||||
LitterBoxStatus.DRAWER_FULL_2: STATE_DOCKED,
|
||||
|
|
|
@ -1950,7 +1950,7 @@ pylibrespot-java==0.1.1
|
|||
pylitejet==0.6.2
|
||||
|
||||
# homeassistant.components.litterrobot
|
||||
pylitterbot==2023.4.9
|
||||
pylitterbot==2023.4.11
|
||||
|
||||
# homeassistant.components.lutron_caseta
|
||||
pylutron-caseta==0.20.0
|
||||
|
|
|
@ -1516,7 +1516,7 @@ pylibrespot-java==0.1.1
|
|||
pylitejet==0.6.2
|
||||
|
||||
# homeassistant.components.litterrobot
|
||||
pylitterbot==2023.4.9
|
||||
pylitterbot==2023.4.11
|
||||
|
||||
# homeassistant.components.lutron_caseta
|
||||
pylutron-caseta==0.20.0
|
||||
|
|
|
@ -33,6 +33,7 @@ ROBOT_4_DATA = {
|
|||
"wifiRssi": -53.0,
|
||||
"unitPowerType": "AC",
|
||||
"catWeight": 12.0,
|
||||
"displayCode": "DC_MODE_IDLE",
|
||||
"unitTimezone": "America/New_York",
|
||||
"unitTime": None,
|
||||
"cleanCycleWaitTime": 15,
|
||||
|
@ -66,7 +67,7 @@ ROBOT_4_DATA = {
|
|||
"isDFIResetPending": False,
|
||||
"DFINumberOfCycles": 104,
|
||||
"DFILevelPercent": 76,
|
||||
"isDFIFull": True,
|
||||
"isDFIFull": False,
|
||||
"DFIFullCounter": 3,
|
||||
"DFITriggerCount": 42,
|
||||
"litterLevel": 460,
|
||||
|
|
|
@ -86,7 +86,7 @@ async def test_litter_robot_sensor(
|
|||
assert sensor.state == "2022-09-17T12:06:37+00:00"
|
||||
assert sensor.attributes["device_class"] == SensorDeviceClass.TIMESTAMP
|
||||
sensor = hass.states.get("sensor.test_status_code")
|
||||
assert sensor.state == "dfs"
|
||||
assert sensor.state == "rdy"
|
||||
assert sensor.attributes["device_class"] == SensorDeviceClass.ENUM
|
||||
sensor = hass.states.get("sensor.test_litter_level")
|
||||
assert sensor.state == "70.0"
|
||||
|
|
|
@ -5,6 +5,7 @@ from __future__ import annotations
|
|||
from typing import Any
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from pylitterbot import Robot
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.litterrobot import DOMAIN
|
||||
|
@ -16,6 +17,7 @@ from homeassistant.components.vacuum import (
|
|||
SERVICE_STOP,
|
||||
STATE_DOCKED,
|
||||
STATE_ERROR,
|
||||
STATE_PAUSED,
|
||||
)
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -96,6 +98,30 @@ async def test_vacuum_with_error(
|
|||
assert vacuum.state == STATE_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),
|
||||
],
|
||||
)
|
||||
async def test_vacuum_states(
|
||||
hass: HomeAssistant,
|
||||
mock_account_with_litterrobot_4: MagicMock,
|
||||
robot_data: dict[str, str | bool],
|
||||
expected_state: str,
|
||||
) -> None:
|
||||
"""Test sending commands to the switch."""
|
||||
await setup_integration(hass, mock_account_with_litterrobot_4, PLATFORM_DOMAIN)
|
||||
robot: Robot = mock_account_with_litterrobot_4.robots[0]
|
||||
robot._update_data(robot_data, partial=True)
|
||||
|
||||
vacuum = hass.states.get(VACUUM_ENTITY_ID)
|
||||
assert vacuum
|
||||
assert vacuum.state == expected_state
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("service", "command", "extra"),
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue