Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions homeassistant/components/roborock/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,11 @@
}
}
}
},
"issues": {
"service_deprecation_start_pause": {
"title": "Roborock vaccum support for vacuum.start_pause is being removed",
"description": "Roborock vaccum 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 changes: 11 additions & 6 deletions homeassistant/components/roborock/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import slugify

Expand Down Expand Up @@ -75,7 +76,6 @@ class RoborockVacuum(RoborockCoordinatedEntity, StateVacuumEntity):
| VacuumEntityFeature.RETURN_HOME
| VacuumEntityFeature.FAN_SPEED
| VacuumEntityFeature.BATTERY
| VacuumEntityFeature.STATUS
| VacuumEntityFeature.SEND_COMMAND
| VacuumEntityFeature.LOCATE
| VacuumEntityFeature.CLEAN_SPOT
Expand Down Expand Up @@ -110,11 +110,6 @@ def fan_speed(self) -> str | None:
"""Return the fan speed of the vacuum cleaner."""
return self._device_status.fan_power.name

@property
def status(self) -> str | None:
"""Return the status of the vacuum cleaner."""
return self._device_status.state.name

async def async_start(self) -> None:
"""Start the vacuum."""
await self.send(RoborockCommand.APP_START)
Expand Down Expand Up @@ -152,6 +147,16 @@ async def async_start_pause(self) -> None:
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(
self,
Expand Down
36 changes: 35 additions & 1 deletion tests/components/roborock/test_vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers import entity_registry as er, issue_registry as ir

from tests.common import MockConfigEntry

Expand Down Expand Up @@ -88,3 +88,37 @@ async def test_commands(
assert mock_send_command.call_count == 1
assert mock_send_command.call_args[0][0] == command
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