Remove deprecated vacuum service from roborock (#107895)
This commit is contained in:
parent
01204356fa
commit
c86b45b454
3 changed files with 1 additions and 68 deletions
|
@ -276,18 +276,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"issues": {
|
|
||||||
"service_deprecation_start_pause": {
|
|
||||||
"title": "Roborock vacuum support for vacuum.start_pause is being removed",
|
|
||||||
"fix_flow": {
|
|
||||||
"step": {
|
|
||||||
"confirm": {
|
|
||||||
"title": "[%key:component::roborock::issues::service_deprecation_start_pause::title%]",
|
|
||||||
"description": "Roborock vacuum support for the vacuum.start_pause service is deprecated and will be removed in Home Assistant 2024.2; Please adjust any automation or script that uses the service to instead call vacuum.pause or vacuum.start and select submit below to mark this issue as resolved."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ from homeassistant.components.vacuum import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import issue_registry as ir
|
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
|
@ -149,23 +148,6 @@ class RoborockVacuum(RoborockCoordinatedEntity, StateVacuumEntity):
|
||||||
[self._device_status.get_fan_speed_code(fan_speed)],
|
[self._device_status.get_fan_speed_code(fan_speed)],
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_start_pause(self) -> None:
|
|
||||||
"""Start, pause or resume the cleaning task."""
|
|
||||||
if self.state == STATE_CLEANING:
|
|
||||||
await self.async_pause()
|
|
||||||
else:
|
|
||||||
await self.async_start()
|
|
||||||
ir.async_create_issue(
|
|
||||||
self.hass,
|
|
||||||
DOMAIN,
|
|
||||||
"service_deprecation_start_pause",
|
|
||||||
breaks_in_ha_version="2024.2.0",
|
|
||||||
is_fixable=True,
|
|
||||||
is_persistent=True,
|
|
||||||
severity=ir.IssueSeverity.WARNING,
|
|
||||||
translation_key="service_deprecation_start_pause",
|
|
||||||
)
|
|
||||||
|
|
||||||
async def async_send_command(
|
async def async_send_command(
|
||||||
self,
|
self,
|
||||||
command: str,
|
command: str,
|
||||||
|
|
|
@ -15,12 +15,11 @@ from homeassistant.components.vacuum import (
|
||||||
SERVICE_SEND_COMMAND,
|
SERVICE_SEND_COMMAND,
|
||||||
SERVICE_SET_FAN_SPEED,
|
SERVICE_SET_FAN_SPEED,
|
||||||
SERVICE_START,
|
SERVICE_START,
|
||||||
SERVICE_START_PAUSE,
|
|
||||||
SERVICE_STOP,
|
SERVICE_STOP,
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, Platform
|
from homeassistant.const import ATTR_ENTITY_ID, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er, issue_registry as ir
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
@ -46,7 +45,6 @@ async def test_registry_entries(
|
||||||
(SERVICE_RETURN_TO_BASE, RoborockCommand.APP_CHARGE, None, None),
|
(SERVICE_RETURN_TO_BASE, RoborockCommand.APP_CHARGE, None, None),
|
||||||
(SERVICE_CLEAN_SPOT, RoborockCommand.APP_SPOT, None, None),
|
(SERVICE_CLEAN_SPOT, RoborockCommand.APP_SPOT, None, None),
|
||||||
(SERVICE_LOCATE, RoborockCommand.FIND_ME, None, None),
|
(SERVICE_LOCATE, RoborockCommand.FIND_ME, None, None),
|
||||||
(SERVICE_START_PAUSE, RoborockCommand.APP_START, None, None),
|
|
||||||
(
|
(
|
||||||
SERVICE_SET_FAN_SPEED,
|
SERVICE_SET_FAN_SPEED,
|
||||||
RoborockCommand.SET_CUSTOM_MODE,
|
RoborockCommand.SET_CUSTOM_MODE,
|
||||||
|
@ -88,37 +86,3 @@ async def test_commands(
|
||||||
assert mock_send_command.call_count == 1
|
assert mock_send_command.call_count == 1
|
||||||
assert mock_send_command.call_args[0][0] == command
|
assert mock_send_command.call_args[0][0] == command
|
||||||
assert mock_send_command.call_args[0][1] == called_params
|
assert mock_send_command.call_args[0][1] == called_params
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
("service", "issue_id"),
|
|
||||||
[
|
|
||||||
(SERVICE_START_PAUSE, "service_deprecation_start_pause"),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
async def test_issues(
|
|
||||||
hass: HomeAssistant,
|
|
||||||
bypass_api_fixture,
|
|
||||||
setup_entry: MockConfigEntry,
|
|
||||||
service: str,
|
|
||||||
issue_id: str,
|
|
||||||
) -> None:
|
|
||||||
"""Test issues raised by calling deprecated services."""
|
|
||||||
vacuum = hass.states.get(ENTITY_ID)
|
|
||||||
assert vacuum
|
|
||||||
|
|
||||||
data = {ATTR_ENTITY_ID: ENTITY_ID}
|
|
||||||
with patch(
|
|
||||||
"homeassistant.components.roborock.coordinator.RoborockLocalClient.send_command"
|
|
||||||
):
|
|
||||||
await hass.services.async_call(
|
|
||||||
Platform.VACUUM,
|
|
||||||
service,
|
|
||||||
data,
|
|
||||||
blocking=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
issue_registry = ir.async_get(hass)
|
|
||||||
issue = issue_registry.async_get_issue("roborock", issue_id)
|
|
||||||
assert issue.is_fixable is True
|
|
||||||
assert issue.is_persistent is True
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue