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
7 changes: 5 additions & 2 deletions roborock/devices/traits/a01/device_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@
}
)

# Devices known to lack DEFAULT_SETTING (DP 225).
# Devices known to lack DEFAULT_SETTING (DP 225). These models have a softener
# compartment but never answer the DP 225 query, so requesting it stalls the
# force-load until it times out.
_UNSUPPORTED_DEFAULT_SETTING: frozenset[str] = frozenset(
{
"roborock.wm.a63", # H1
"roborock.wm.a90", # H1 Lite / H1 Neo
}
)

Expand Down Expand Up @@ -250,7 +253,7 @@ def supports_feature_bits(model: str | None) -> bool:


def supports_default_setting(model: str | None) -> bool:
"""H1 (a63) does not support DP 225 even though it has a softener compartment."""
"""H1 (a63) and H1 Lite (a90) do not support DP 225 despite having a softener compartment."""
if model is None:
return True # conservative: assume yes
return model not in _UNSUPPORTED_DEFAULT_SETTING
Expand Down
12 changes: 7 additions & 5 deletions tests/devices/traits/a01/test_device_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@
[
("roborock.wm.a63", False), # H1
("roborock.wm.a102", True), # H1 Overseas
("roborock.wm.a90", True), # H1 Lite
("roborock.wm.a90", False), # H1 Lite / H1 Neo
("roborock.wm.a91", True), # H1 Lite Overseas
(None, True), # unknown model: assume supported
],
)
def test_supports_default_setting(model: str | None, expected: bool) -> None:
"""DP 225 is unsupported on H1 (a63) only."""
"""DP 225 is unsupported on H1 (a63) and H1 Lite (a90)."""
assert supports_default_setting(model) is expected


def test_force_load_omits_default_setting_for_h1() -> None:
"""H1 (a63) has a softener compartment but must not be queried for DP 225."""
dp_list = build_force_load_dp_list("roborock.wm.a63")
@pytest.mark.parametrize("model", ["roborock.wm.a63", "roborock.wm.a90"])
def test_force_load_omits_default_setting_for_h1(model: str) -> None:
"""H1 variants have a softener compartment but must not be queried for DP 225."""
dp_list = build_force_load_dp_list(model)

assert RoborockZeoProtocol.DEFAULT_SETTING not in dp_list
# The remaining softener DPs are still queried.
Expand Down
Loading