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/data/v1/v1_code_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class RoborockInCleaning(RoborockEnum):
global_clean_not_complete = 1
zone_clean_not_complete = 2
segment_clean_not_complete = 3
quick_build_map_not_complete = 4
segment_zone_clean_not_complete = 11 # Rooms and zones cleaned in one task


class RoborockCleanType(RoborockEnum):
Expand Down
14 changes: 13 additions & 1 deletion tests/data/test_code_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def test_dyad_clean_mode_unknown_code() -> None:
[
(RoborockErrorCode, 57),
(RoborockDockErrorCode, 9),
(RoborockInCleaning, 4),
(RoborockInCleaning, 5),
(RoborockFinishReason, 78),
(RoborockCleanType, 9),
(RoborockStartType, 999),
Expand All @@ -249,3 +249,15 @@ def test_dyad_clean_mode_unknown_code() -> None:
def test_v1_enum_unknown_code(enum_cls: type[RoborockEnum], code: int) -> None:
"""An unrecognized V1 code falls back to 'unknown' instead of the first member."""
assert enum_cls(code).name == "unknown"


@pytest.mark.parametrize(
("code", "name"),
[
(4, "quick_build_map_not_complete"),
(11, "segment_zone_clean_not_complete"),
],
)
def test_v1_in_cleaning_resume_codes(code: int, name: str) -> None:
"""The in_cleaning codes for unfinished map building and combined cleans decode by name."""
assert RoborockInCleaning(code).name == name
Loading