Skip to content
Open
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
2 changes: 2 additions & 0 deletions roborock/devices/traits/v1/wash_towel_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def wash_towel_mode_options(self) -> list[WashTowelModes]:
async def set_wash_towel_mode(self, mode: WashTowelModes) -> None:
"""Set the wash towel mode."""
await self.rpc_channel.send_command(RoborockCommand.SET_WASH_TOWEL_MODE, params={"wash_mode": mode.code})
# Optimistic update to avoid an extra refresh
self.wash_mode = mode

async def start_wash(self) -> None:
"""Start washing the mop."""
Expand Down
1 change: 1 addition & 0 deletions tests/devices/traits/v1/test_wash_towel_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async def test_set_wash_towel_mode(
mock_rpc_channel.send_command.assert_called_with(
RoborockCommand.SET_WASH_TOWEL_MODE, params={"wash_mode": wash_mode.code}
)
assert wash_towel_mode.wash_mode == wash_mode


@pytest.mark.parametrize(
Expand Down
Loading