diff --git a/deebot_client/commands/json/clean.py b/deebot_client/commands/json/clean.py index 3e8dafd59..920a24b05 100644 --- a/deebot_client/commands/json/clean.py +++ b/deebot_client/commands/json/clean.py @@ -95,10 +95,16 @@ class CleanAreaV2(CleanV2): """Clean area command.""" def __init__(self, mode: CleanMode, area: list[int | float], _: int = 1) -> None: - self._additional_content = { - "type": mode.value, - "value": ",".join(str(i) for i in area), - } + if mode == CleanMode.SPOT_AREA: + self._additional_content = { + "type": CleanMode.FREE_CLEAN.value, + "value": ";".join(("1," + str(i)) for i in area), + } + else: + self._additional_content = { + "type": mode, + "value": ",".join(str(i) for i in area), + } super().__init__(CleanAction.START) def _get_args(self, action: CleanAction) -> dict[str, Any]: diff --git a/deebot_client/models.py b/deebot_client/models.py index c3493a95d..2502556fa 100644 --- a/deebot_client/models.py +++ b/deebot_client/models.py @@ -81,6 +81,7 @@ class CleanMode(StrEnumWithXml): AUTO = "auto", "auto" SPOT_AREA = "spotArea", "SpotArea" CUSTOM_AREA = "customArea", "spot" + FREE_CLEAN = "freeClean", "freeClean" @dataclass(frozen=True) diff --git a/tests/commands/json/test_clean.py b/tests/commands/json/test_clean.py index cd2fc5851..9d6d0e33a 100644 --- a/tests/commands/json/test_clean.py +++ b/tests/commands/json/test_clean.py @@ -115,7 +115,7 @@ async def test_Clean_act( ), ( CleanAreaV2(CleanMode.SPOT_AREA, [5, 8]), - {"act": "start", "content": {"type": "spotArea", "value": "5,8"}}, + {"act": "start", "content": {"type": "freeClean", "value": "1,5;1,8"}}, ), ( CleanArea(CleanMode.CUSTOM_AREA, [1580.0, -4087.0, 3833.0, -7525.0]),