Skip to content

Commit 25185b0

Browse files
authored
fix: skip DP 225 on Zeo H1 (roborock.wm.a63) (#946)
The H1 has a softener compartment, so build_force_load_dp_list() asked it for DEFAULT_SETTING (DP 225), which the device never returns. Since send_decoded_command() only completes a query once every requested DP has arrived, the whole force-load timed out after 10s and every DP the device did answer was discarded, leaving no Zeo state loaded. Gate DP 225 behind a model set, matching how FEATURE_BITS (DP 237) is already handled for this same device.
1 parent a61f96e commit 25185b0

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

roborock/devices/traits/a01/device_feature.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@
143143
}
144144
)
145145

146+
# Devices known to lack DEFAULT_SETTING (DP 225).
147+
_UNSUPPORTED_DEFAULT_SETTING: frozenset[str] = frozenset(
148+
{
149+
"roborock.wm.a63", # H1
150+
}
151+
)
152+
146153
# Series that support UV light (DP 228).
147154
_UV_LIGHT_SERIES: frozenset[str] = (
148155
_H1_LITE_SERIES # a90, a91, a237
@@ -242,6 +249,13 @@ def supports_feature_bits(model: str | None) -> bool:
242249
return model not in _UNSUPPORTED_FEATURE_BITS
243250

244251

252+
def supports_default_setting(model: str | None) -> bool:
253+
"""H1 (a63) does not support DP 225 even though it has a softener compartment."""
254+
if model is None:
255+
return True # conservative: assume yes
256+
return model not in _UNSUPPORTED_DEFAULT_SETTING
257+
258+
245259
def supports_remote_control(model: str | None) -> bool:
246260
"""Remote control (DP 232) is supported on all overseas models."""
247261
if model is None:
@@ -309,6 +323,10 @@ def build_force_load_dp_list(model: str | None) -> list[RoborockZeoProtocol]:
309323
if not supports_feature_bits(model):
310324
base = [dp for dp in base if dp != RoborockZeoProtocol.FEATURE_BITS]
311325

326+
# ── Strip unsupported DEFAULT_SETTING ──
327+
if not supports_default_setting(model):
328+
base = [dp for dp in base if dp != RoborockZeoProtocol.DEFAULT_SETTING]
329+
312330
return base
313331

314332

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""Tests for A01 (Zeo) per-model feature gating."""
2+
3+
import pytest
4+
5+
from roborock.devices.traits.a01.device_feature import build_force_load_dp_list, supports_default_setting
6+
from roborock.roborock_message import RoborockZeoProtocol
7+
8+
9+
@pytest.mark.parametrize(
10+
("model", "expected"),
11+
[
12+
("roborock.wm.a63", False), # H1
13+
("roborock.wm.a102", True), # H1 Overseas
14+
("roborock.wm.a90", True), # H1 Lite
15+
(None, True), # unknown model: assume supported
16+
],
17+
)
18+
def test_supports_default_setting(model: str | None, expected: bool) -> None:
19+
"""DP 225 is unsupported on H1 (a63) only."""
20+
assert supports_default_setting(model) is expected
21+
22+
23+
def test_force_load_omits_default_setting_for_h1() -> None:
24+
"""H1 (a63) has a softener compartment but must not be queried for DP 225."""
25+
dp_list = build_force_load_dp_list("roborock.wm.a63")
26+
27+
assert RoborockZeoProtocol.DEFAULT_SETTING not in dp_list
28+
# The remaining softener DPs are still queried.
29+
assert RoborockZeoProtocol.SOFTENER_SET in dp_list
30+
assert RoborockZeoProtocol.SOFTENER_TYPE in dp_list
31+
assert RoborockZeoProtocol.SOFTENER_EMPTY in dp_list
32+
33+
34+
def test_force_load_keeps_default_setting_for_other_softener_models() -> None:
35+
"""Other softener-equipped models still query DP 225."""
36+
assert RoborockZeoProtocol.DEFAULT_SETTING in build_force_load_dp_list("roborock.wm.a102")
37+
38+
39+
def test_force_load_omits_default_setting_without_softener() -> None:
40+
"""Models without a softener compartment never query DP 225."""
41+
assert RoborockZeoProtocol.DEFAULT_SETTING not in build_force_load_dp_list("roborock.wm.a92")

0 commit comments

Comments
 (0)