mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 07:25:52 -05:00
Bump Roborock to 17.0 adding device specific support and bugfixes (#92547)
* init commit * use official version release * remove options * moved first refresh to gather * add extra tests * remove model_sepcification * remove old mqtt test * bump to 13.4 * fix dndtimer * bump to 14.1 * add status back * bump to 17.0 * remove error as it is not used * addressing mr comments * making enum access use get() * add check for empty hass data
This commit is contained in:
@@ -5,13 +5,13 @@ from roborock.containers import (
|
||||
CleanRecord,
|
||||
CleanSummary,
|
||||
Consumable,
|
||||
DNDTimer,
|
||||
DnDTimer,
|
||||
HomeData,
|
||||
NetworkInfo,
|
||||
Status,
|
||||
S7Status,
|
||||
UserData,
|
||||
)
|
||||
from roborock.typing import DeviceProp
|
||||
from roborock.roborock_typing import DeviceProp
|
||||
|
||||
# All data is based on a U.S. customer with a Roborock S7 MaxV Ultra
|
||||
USER_EMAIL = "user@domain.com"
|
||||
@@ -311,7 +311,7 @@ CONSUMABLE = Consumable.from_dict(
|
||||
}
|
||||
)
|
||||
|
||||
DND_TIMER = DNDTimer.from_dict(
|
||||
DND_TIMER = DnDTimer.from_dict(
|
||||
{
|
||||
"start_hour": 22,
|
||||
"start_minute": 0,
|
||||
@@ -321,7 +321,7 @@ DND_TIMER = DNDTimer.from_dict(
|
||||
}
|
||||
)
|
||||
|
||||
STATUS = Status.from_dict(
|
||||
STATUS = S7Status.from_dict(
|
||||
{
|
||||
"msg_ver": 2,
|
||||
"msg_seq": 458,
|
||||
@@ -367,7 +367,6 @@ STATUS = Status.from_dict(
|
||||
"unsave_map_flag": 0,
|
||||
}
|
||||
)
|
||||
|
||||
PROP = DeviceProp(STATUS, DND_TIMER, CLEAN_SUMMARY, CONSUMABLE, CLEAN_RECORD)
|
||||
|
||||
NETWORK_INFO = NetworkInfo(
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
"""Test for Roborock init."""
|
||||
from unittest.mock import patch
|
||||
|
||||
from roborock.exceptions import RoborockTimeout
|
||||
|
||||
from homeassistant.components.roborock.const import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
@@ -10,7 +8,6 @@ from homeassistant.helpers.update_coordinator import UpdateFailed
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
from tests.components.roborock.mock_data import HOME_DATA, NETWORK_INFO
|
||||
|
||||
|
||||
async def test_unload_entry(
|
||||
@@ -41,23 +38,3 @@ async def test_config_entry_not_ready(
|
||||
):
|
||||
await async_setup_component(hass, DOMAIN, {})
|
||||
assert mock_roborock_entry.state is ConfigEntryState.SETUP_RETRY
|
||||
|
||||
|
||||
async def test_continue_setup_mqtt_disconnect_fail(
|
||||
hass: HomeAssistant, mock_roborock_entry: MockConfigEntry
|
||||
):
|
||||
"""Test that if disconnect fails, we still continue setting up."""
|
||||
with patch(
|
||||
"homeassistant.components.roborock.RoborockApiClient.get_home_data",
|
||||
return_value=HOME_DATA,
|
||||
), patch(
|
||||
"homeassistant.components.roborock.RoborockMqttClient.get_networking",
|
||||
return_value=NETWORK_INFO,
|
||||
), patch(
|
||||
"homeassistant.components.roborock.RoborockMqttClient.async_disconnect",
|
||||
side_effect=RoborockTimeout(),
|
||||
), patch(
|
||||
"homeassistant.components.roborock.RoborockDataUpdateCoordinator.async_config_entry_first_refresh"
|
||||
):
|
||||
await async_setup_component(hass, DOMAIN, {})
|
||||
assert mock_roborock_entry.state is ConfigEntryState.LOADED
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from roborock.typing import RoborockCommand
|
||||
from roborock.roborock_typing import RoborockCommand
|
||||
|
||||
from homeassistant.components.vacuum import (
|
||||
SERVICE_CLEAN_SPOT,
|
||||
@@ -50,7 +50,7 @@ async def test_registry_entries(
|
||||
(
|
||||
SERVICE_SET_FAN_SPEED,
|
||||
RoborockCommand.SET_CUSTOM_MODE,
|
||||
{"fan_speed": "silent"},
|
||||
{"fan_speed": "quiet"},
|
||||
[101],
|
||||
),
|
||||
(
|
||||
@@ -86,6 +86,5 @@ async def test_commands(
|
||||
blocking=True,
|
||||
)
|
||||
assert mock_send_command.call_count == 1
|
||||
assert mock_send_command.call_args[0][0] == DEVICE_ID
|
||||
assert mock_send_command.call_args[0][1] == command
|
||||
assert mock_send_command.call_args[0][2] == called_params
|
||||
assert mock_send_command.call_args[0][0] == command
|
||||
assert mock_send_command.call_args[0][1] == called_params
|
||||
|
||||
Reference in New Issue
Block a user