mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 06:05:26 +01:00
Bump python roborock to 2.44.1 (#152557)
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
"loggers": ["roborock"],
|
||||
"quality_scale": "silver",
|
||||
"requirements": [
|
||||
"python-roborock==2.18.2",
|
||||
"python-roborock==2.44.1",
|
||||
"vacuum-map-parser-roborock==0.1.4"
|
||||
]
|
||||
}
|
||||
|
||||
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@@ -2522,7 +2522,7 @@ python-rabbitair==0.0.8
|
||||
python-ripple-api==0.0.3
|
||||
|
||||
# homeassistant.components.roborock
|
||||
python-roborock==2.18.2
|
||||
python-roborock==2.44.1
|
||||
|
||||
# homeassistant.components.smarttub
|
||||
python-smarttub==0.0.44
|
||||
|
||||
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@@ -2095,7 +2095,7 @@ python-pooldose==0.5.0
|
||||
python-rabbitair==0.0.8
|
||||
|
||||
# homeassistant.components.roborock
|
||||
python-roborock==2.18.2
|
||||
python-roborock==2.44.1
|
||||
|
||||
# homeassistant.components.smarttub
|
||||
python-smarttub==0.0.44
|
||||
|
||||
@@ -87,7 +87,7 @@ def bypass_api_client_fixture() -> None:
|
||||
|
||||
|
||||
@pytest.fixture(name="bypass_api_fixture")
|
||||
def bypass_api_fixture(bypass_api_client_fixture: Any) -> None:
|
||||
def bypass_api_fixture(bypass_api_client_fixture: Any, mock_send_message: Mock) -> None:
|
||||
"""Skip calls to the API."""
|
||||
with (
|
||||
patch("homeassistant.components.roborock.RoborockMqttClientV1.async_connect"),
|
||||
@@ -116,7 +116,7 @@ def bypass_api_fixture(bypass_api_client_fixture: Any) -> None:
|
||||
return_value=MAP_DATA,
|
||||
),
|
||||
patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_message"
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1._send_message"
|
||||
),
|
||||
patch("homeassistant.components.roborock.RoborockMqttClientV1._wait_response"),
|
||||
patch(
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
'coordinators': dict({
|
||||
'**REDACTED-0**': dict({
|
||||
'api': dict({
|
||||
'misc_info': dict({
|
||||
}),
|
||||
}),
|
||||
'roborock_device_info': dict({
|
||||
'device': dict({
|
||||
@@ -319,8 +317,6 @@
|
||||
}),
|
||||
'**REDACTED-1**': dict({
|
||||
'api': dict({
|
||||
'misc_info': dict({
|
||||
}),
|
||||
}),
|
||||
'roborock_device_info': dict({
|
||||
'device': dict({
|
||||
@@ -606,8 +602,6 @@
|
||||
}),
|
||||
'**REDACTED-2**': dict({
|
||||
'api': dict({
|
||||
'misc_info': dict({
|
||||
}),
|
||||
}),
|
||||
'roborock_device_info': dict({
|
||||
'device': dict({
|
||||
@@ -969,8 +963,6 @@
|
||||
}),
|
||||
'**REDACTED-3**': dict({
|
||||
'api': dict({
|
||||
'misc_info': dict({
|
||||
}),
|
||||
}),
|
||||
'roborock_device_info': dict({
|
||||
'device': dict({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"""Test Roborock Button platform."""
|
||||
|
||||
from unittest.mock import ANY, patch
|
||||
from unittest.mock import ANY, Mock, patch
|
||||
|
||||
import pytest
|
||||
import roborock
|
||||
from roborock import RoborockException
|
||||
from roborock.exceptions import RoborockTimeout
|
||||
|
||||
from homeassistant.components.button import SERVICE_PRESS
|
||||
from homeassistant.const import Platform
|
||||
@@ -48,19 +48,17 @@ async def test_update_success(
|
||||
bypass_api_fixture,
|
||||
setup_entry: MockConfigEntry,
|
||||
entity_id: str,
|
||||
mock_send_message: Mock,
|
||||
) -> None:
|
||||
"""Test pressing the button entities."""
|
||||
# Ensure that the entity exist, as these test can pass even if there is no entity.
|
||||
assert hass.states.get(entity_id).state == "unknown"
|
||||
with patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_message"
|
||||
) as mock_send_message:
|
||||
await hass.services.async_call(
|
||||
"button",
|
||||
SERVICE_PRESS,
|
||||
blocking=True,
|
||||
target={"entity_id": entity_id},
|
||||
)
|
||||
await hass.services.async_call(
|
||||
"button",
|
||||
SERVICE_PRESS,
|
||||
blocking=True,
|
||||
target={"entity_id": entity_id},
|
||||
)
|
||||
assert mock_send_message.assert_called_once
|
||||
assert hass.states.get(entity_id).state == "2023-10-30T08:50:00+00:00"
|
||||
|
||||
@@ -73,21 +71,19 @@ async def test_update_success(
|
||||
)
|
||||
@pytest.mark.freeze_time("2023-10-30 08:50:00")
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
@pytest.mark.parametrize("send_message_side_effect", [RoborockTimeout])
|
||||
async def test_update_failure(
|
||||
hass: HomeAssistant,
|
||||
bypass_api_fixture,
|
||||
setup_entry: MockConfigEntry,
|
||||
entity_id: str,
|
||||
mock_send_message: Mock,
|
||||
) -> None:
|
||||
"""Test failure while pressing the button entity."""
|
||||
# Ensure that the entity exist, as these test can pass even if there is no entity.
|
||||
assert hass.states.get(entity_id).state == "unknown"
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_message",
|
||||
side_effect=roborock.exceptions.RoborockTimeout,
|
||||
) as mock_send_message,
|
||||
pytest.raises(HomeAssistantError, match="Error while calling RESET_CONSUMABLE"),
|
||||
with pytest.raises(
|
||||
HomeAssistantError, match="Error while calling RESET_CONSUMABLE"
|
||||
):
|
||||
await hass.services.async_call(
|
||||
"button",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
"""Test Roborock Number platform."""
|
||||
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
import roborock
|
||||
from roborock.exceptions import RoborockTimeout
|
||||
|
||||
from homeassistant.components.number import ATTR_VALUE, SERVICE_SET_VALUE
|
||||
from homeassistant.const import Platform
|
||||
@@ -31,20 +31,18 @@ async def test_update_success(
|
||||
setup_entry: MockConfigEntry,
|
||||
entity_id: str,
|
||||
value: float,
|
||||
mock_send_message: Mock,
|
||||
) -> None:
|
||||
"""Test allowed changing values for number entities."""
|
||||
# Ensure that the entity exist, as these test can pass even if there is no entity.
|
||||
assert hass.states.get(entity_id) is not None
|
||||
with patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_message"
|
||||
) as mock_send_message:
|
||||
await hass.services.async_call(
|
||||
"number",
|
||||
SERVICE_SET_VALUE,
|
||||
service_data={ATTR_VALUE: value},
|
||||
blocking=True,
|
||||
target={"entity_id": entity_id},
|
||||
)
|
||||
await hass.services.async_call(
|
||||
"number",
|
||||
SERVICE_SET_VALUE,
|
||||
service_data={ATTR_VALUE: value},
|
||||
blocking=True,
|
||||
target={"entity_id": entity_id},
|
||||
)
|
||||
assert mock_send_message.assert_called_once
|
||||
|
||||
|
||||
@@ -54,23 +52,19 @@ async def test_update_success(
|
||||
("number.roborock_s7_maxv_volume", 3.0),
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize("send_message_side_effect", [RoborockTimeout])
|
||||
async def test_update_failed(
|
||||
hass: HomeAssistant,
|
||||
bypass_api_fixture,
|
||||
setup_entry: MockConfigEntry,
|
||||
entity_id: str,
|
||||
value: float,
|
||||
mock_send_message: Mock,
|
||||
) -> None:
|
||||
"""Test allowed changing values for number entities."""
|
||||
# Ensure that the entity exist, as these test can pass even if there is no entity.
|
||||
assert hass.states.get(entity_id) is not None
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_message",
|
||||
side_effect=roborock.exceptions.RoborockTimeout,
|
||||
) as mock_send_message,
|
||||
pytest.raises(HomeAssistantError, match="Failed to update Roborock options"),
|
||||
):
|
||||
with pytest.raises(HomeAssistantError, match="Failed to update Roborock options"):
|
||||
await hass.services.async_call(
|
||||
"number",
|
||||
SERVICE_SET_VALUE,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Test Roborock Select platform."""
|
||||
|
||||
import copy
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from roborock.exceptions import RoborockException
|
||||
@@ -37,36 +37,30 @@ async def test_update_success(
|
||||
setup_entry: MockConfigEntry,
|
||||
entity_id: str,
|
||||
value: str,
|
||||
mock_send_message: Mock,
|
||||
) -> None:
|
||||
"""Test allowed changing values for select entities."""
|
||||
# Ensure that the entity exist, as these test can pass even if there is no entity.
|
||||
assert hass.states.get(entity_id) is not None
|
||||
with patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_message"
|
||||
) as mock_send_message:
|
||||
await hass.services.async_call(
|
||||
"select",
|
||||
SERVICE_SELECT_OPTION,
|
||||
service_data={"option": value},
|
||||
blocking=True,
|
||||
target={"entity_id": entity_id},
|
||||
)
|
||||
await hass.services.async_call(
|
||||
"select",
|
||||
SERVICE_SELECT_OPTION,
|
||||
service_data={"option": value},
|
||||
blocking=True,
|
||||
target={"entity_id": entity_id},
|
||||
)
|
||||
assert mock_send_message.assert_called_once
|
||||
|
||||
|
||||
@pytest.mark.parametrize("send_message_side_effect", [RoborockException])
|
||||
async def test_update_failure(
|
||||
hass: HomeAssistant,
|
||||
bypass_api_fixture,
|
||||
setup_entry: MockConfigEntry,
|
||||
mock_send_message: Mock,
|
||||
) -> None:
|
||||
"""Test that changing a value will raise a homeassistanterror when it fails."""
|
||||
with (
|
||||
patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_message",
|
||||
side_effect=RoborockException(),
|
||||
),
|
||||
pytest.raises(HomeAssistantError, match="Error while calling SET_MOP_MOD"),
|
||||
):
|
||||
with pytest.raises(HomeAssistantError, match="Error while calling SET_MOP_MOD"):
|
||||
await hass.services.async_call(
|
||||
"select",
|
||||
SERVICE_SELECT_OPTION,
|
||||
|
||||
Reference in New Issue
Block a user