From 839cb84a549b660733b3ffe9e1e6458cf463d017 Mon Sep 17 00:00:00 2001 From: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com> Date: Fri, 24 Jul 2026 17:21:24 -0700 Subject: [PATCH] feat: add support for dock type 38 Dock type 38 (Qrevo Edge 2, roborock.vacuum.a298) was missing from RoborockDockTypeCode, so RoborockDockTypeCode(38) fell back to unknown. Downstream that made is_valid_dock and is_wash_n_fill_dock return False and the dock traits were skipped, leaving the tank and strainer entities unavailable even though the device reports the data. Add the enum member so the dock resolves to a collect/wash/dry dock, plus a regression test and a parametrized dock-feature case. --- roborock/data/v1/v1_code_mappings.py | 1 + tests/test_supported_features.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/roborock/data/v1/v1_code_mappings.py b/roborock/data/v1/v1_code_mappings.py index 82199186..2b284be8 100644 --- a/roborock/data/v1/v1_code_mappings.py +++ b/roborock/data/v1/v1_code_mappings.py @@ -368,6 +368,7 @@ class RoborockDockTypeCode(RoborockEnum): type_27_dock = 27 k1c_lite_dock = 28 shell_2e_lite_dock = 30 + type_38_dock = 38 shell_2e_heat_dock = 40 diff --git a/tests/test_supported_features.py b/tests/test_supported_features.py index 0a6ac060..39bb7653 100644 --- a/tests/test_supported_features.py +++ b/tests/test_supported_features.py @@ -109,6 +109,7 @@ def test_new_feature_str_missing(): (RoborockDockTypeCode.type_27_dock, True, True), (RoborockDockTypeCode.k1c_lite_dock, True, True), (RoborockDockTypeCode.shell_2e_lite_dock, True, True), + (RoborockDockTypeCode.type_38_dock, True, True), (RoborockDockTypeCode.shell_2e_heat_dock, True, True), ], ) @@ -122,6 +123,19 @@ def test_dock_features(dock_type: RoborockDockTypeCode, is_collectable: bool, is assert is_wash_n_fill_dock(dock_type) is dock_features.is_washable +def test_qrevo_edge_2_dock_type_is_mapped() -> None: + """Dock type 38 (Qrevo Edge 2) must resolve to a real wash-and-dry dock.""" + dock_type = RoborockDockTypeCode(38) + + assert dock_type is not RoborockDockTypeCode.unknown + assert is_valid_dock(dock_type) + assert is_wash_n_fill_dock(dock_type) + + dock_features = RoborockDockFeatures.from_dock_type(dock_type) + assert dock_features.is_collectable + assert dock_features.is_dryable + + def test_dock_feature_flags_from_rr_api() -> None: """Verify dock-specific feature flags that are not currently trait gates.""" assert RoborockDockFeatures.from_dock_type(RoborockDockTypeCode.shell_3s_dock).is_auto_sterilize_supported