Skip to content

Commit 2304dd6

Browse files
authored
feat: add V1 dock types 48 and 50 and fix F2R, K1S and Hera dock capabilities (#1047)
* feat: add new V1 dock types and align dock capabilities with the app Add dock type codes 48 (F1RC) and 50 (F2RS), app-name aliases for codes 27 and 49, the capabilities of codes 48-50, and three new dock properties. K1S gets automatic fluid delivery, Hera the hatch-door cool fan, and F2R no longer reports carousel self-cleaning, following the newest app plugins. * refactor: drop the separate Shell E hot wash dock flag is_hot_wash_towel_supported stays the robot firmware signal and its docs now say the Shell E dock cannot wash with hot water. The wash water temperature trait will check the dock instead, so consumers do not need to combine two flags.
1 parent 321c6d5 commit 2304dd6

4 files changed

Lines changed: 215 additions & 4 deletions

File tree

‎docs/V1_DEVICE_FEATURES.md‎

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This document provides comprehensive documentation for each `DeviceFeature` in t
1212
- [Robot Features (Array-based)](#robot-features-array-based)
1313
- [Model-Specific Features](#model-specific-features)
1414
- [Product Features](#product-features)
15+
- [Dock Features](#dock-features)
1516

1617
---
1718

@@ -682,7 +683,7 @@ These features are encoded as individual bits in the `new_feature_info_str` hex
682683
### is_hot_wash_towel_supported
683684
**Bit Index:** 41
684685
**Feature:** Hot Water Mop Washing
685-
**Description:** Dock uses hot water to wash mop pads.
686+
**Description:** Dock uses hot water to wash mop pads. The robot firmware reports this, so it does not account for the dock: a Shell E dock cannot wash with hot water.
686687
**Impact:** Better mop cleaning and sanitization.
687688

688689
---
@@ -1435,3 +1436,53 @@ These features are determined by hardware capabilities and product variant.
14351436
**Feature:** Customized Clean Settings
14361437
**Description:** Advanced customization for mop-equipped models.
14371438
**Impact:** Detailed control over mopping parameters.
1439+
1440+
---
1441+
1442+
## Dock Features
1443+
1444+
Dock capabilities are not part of `DeviceFeatures`. `RoborockDockFeatures.from_dock_type(dock_type, has_am)` derives
1445+
them from two status values:
1446+
1447+
- `Status.dock_type` (`RoborockDockTypeCode`): the dock family. Unknown codes fall back to `unknown`, which counts as
1448+
no dock.
1449+
- `Status.has_am` (`(dss & 3) == 2`): whether the dock is the "A"/"AM" variant. The app lists these variants under
1450+
their own names (for example Shell 2SA, O5AM, K1SProA), but they report the same `dock_type` code as the base dock.
1451+
1452+
Some codes have two member names. `type_27_dock` and `type_49_dock` are the original names and stay the canonical
1453+
ones; `shell_4_dock` (27) and `f1rs_dock` (49) are aliases with the app's dock names.
1454+
1455+
| Code | Member | App dock names |
1456+
|---|---|---|
1457+
| 27 | `type_27_dock` (alias `shell_4_dock`) | Shell4, Shell4A |
1458+
| 48 | `f1rc_dock` | F1RC, F1RCA |
1459+
| 49 | `type_49_dock` (alias `f1rs_dock`) | F1RS, F1RSA |
1460+
| 50 | `f2rs_dock` | F2RS, F2RSA |
1461+
1462+
The table lists the codes that are new or whose member name differs from the app's dock name. Every other member name
1463+
follows the app's dock name (for example `shell_3s_dock` is Shell 3S / Shell 3SA).
1464+
1465+
Dock types: `has_dock`, `is_pure_collect`, `is_pure_wash`, `is_collect_wash`, `is_collect_wash_dry` and the derived
1466+
`is_collectable`, `is_washable` and `is_dryable`. Every dock type except no dock (O0, `unknown`), pure collect (O1,
1467+
OC), pure wash (O2) and collect-wash (O3) is a collect, wash and dry dock.
1468+
1469+
Capabilities that depend on `has_am`:
1470+
1471+
- `is_clean_fluid_auto_delivery_supported`: several Shell and K1 docks only in the AM variant.
1472+
- `is_clean_carousel_self_clean_supported`: only docks without AM. The F2R dock (43) is not included: the newest app
1473+
plugins no longer offer carousel self-cleaning for it. Older plugins still did, and earlier library versions
1474+
reported it as supported.
1475+
- `is_water_updown_drain_supported`: mostly the AM variant (it has the water drain module).
1476+
- `is_double_serial_communication_supported`: Shell 4RC and Shell 4D only in the AM variant.
1477+
- `is_multi_clean_fluid_supported`: Shell 4S without AM.
1478+
1479+
Other capabilities depend only on the code:
1480+
1481+
### is_clean_carousel_supported
1482+
**Docks:** Pearl, Couple, Hera, Shell (except Shell 4R), K1 and F-series docks; none of the O-series docks.
1483+
**Description:** The dock has a carousel (wash tray strainer) that the app shows as a consumable.
1484+
1485+
### is_special_support_wash_temp
1486+
**Docks:** Shell 2E Lite
1487+
**Description:** Dock part of the app's check of the same name. The app also checks the product: it is true for every
1488+
product except PearlEPro, which needs a Shell 2E Lite dock.

‎roborock/data/v1/v1_code_mappings.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@ class RoborockDockErrorCode(RoborockEnum):
350350

351351

352352
class RoborockDockTypeCode(RoborockEnum):
353+
"""V1 `dock_type` codes.
354+
355+
The app's "A"/"AM" dock variants (for example Shell 2SA or O5AM) are not separate codes: they report the same
356+
code as the base dock, and `Status.has_am` tells them apart.
357+
"""
358+
353359
unknown = -9999
354360
o0_dock = 0
355361
o1_dock = 1
@@ -376,6 +382,7 @@ class RoborockDockTypeCode(RoborockEnum):
376382
hera_dock = 24
377383
k1s_pro_dock = 26
378384
type_27_dock = 27
385+
shell_4_dock = 27 # noqa: PIE796 # App name of code 27; alias of type_27_dock.
379386
k1c_lite_dock = 28
380387
k1r_dock = 29
381388
shell_2e_lite_dock = 30
@@ -394,7 +401,10 @@ class RoborockDockTypeCode(RoborockEnum):
394401
f1s_dock = 44
395402
o7h_dock = 45
396403
f1c_dock = 46
404+
f1rc_dock = 48
397405
type_49_dock = 49
406+
f1rs_dock = 49 # noqa: PIE796 # App name of code 49; alias of type_49_dock.
407+
f2rs_dock = 50
398408

399409

400410
class RoborockDockDustCollectionModeCode(RoborockEnum):

‎roborock/device_features.py‎

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,14 +754,14 @@ def get_supported_features(self) -> list[str]:
754754
RoborockDockTypeCode.o7_dock,
755755
RoborockDockTypeCode.f1s_dock,
756756
RoborockDockTypeCode.o7h_dock,
757+
RoborockDockTypeCode.k1s_dock,
757758
}
758759

759760
_CLEAN_FLUID_AUTO_DELIVERY_AM_DOCK_TYPES = {
760761
RoborockDockTypeCode.shell_2s_dock,
761762
RoborockDockTypeCode.shell_3_dock,
762763
RoborockDockTypeCode.shell_2c_dock,
763764
RoborockDockTypeCode.k1_dock,
764-
RoborockDockTypeCode.k1s_dock,
765765
RoborockDockTypeCode.shell_e_dock,
766766
RoborockDockTypeCode.shell_2e_dock,
767767
RoborockDockTypeCode.shell_3c_dock,
@@ -804,9 +804,9 @@ def get_supported_features(self) -> list[str]:
804804
RoborockDockTypeCode.k1d_dock,
805805
RoborockDockTypeCode.shell_3p_dock,
806806
RoborockDockTypeCode.f1_dock,
807-
RoborockDockTypeCode.f2r_dock,
808807
RoborockDockTypeCode.f1s_dock,
809808
RoborockDockTypeCode.f1c_dock,
809+
RoborockDockTypeCode.f1rc_dock,
810810
}
811811

812812
_WATER_UPDOWN_DRAIN_DOCK_TYPES = {
@@ -840,10 +840,13 @@ def get_supported_features(self) -> list[str]:
840840
RoborockDockTypeCode.f1r_dock,
841841
RoborockDockTypeCode.f1s_dock,
842842
RoborockDockTypeCode.o7h_dock,
843+
RoborockDockTypeCode.type_49_dock,
844+
RoborockDockTypeCode.f2rs_dock,
843845
}
844846

845847
_HATCH_DOOR_DOCK_COOL_FAN_DOCK_TYPES = {
846848
RoborockDockTypeCode.couple_dock,
849+
RoborockDockTypeCode.hera_dock,
847850
}
848851

849852
_SPECIAL_WASH_TEMP_DOCK_TYPES = {
@@ -858,6 +861,9 @@ def get_supported_features(self) -> list[str]:
858861
RoborockDockTypeCode.f1r_dock,
859862
RoborockDockTypeCode.f2r_dock,
860863
RoborockDockTypeCode.f1c_dock,
864+
RoborockDockTypeCode.f1rc_dock,
865+
RoborockDockTypeCode.type_49_dock,
866+
RoborockDockTypeCode.f2rs_dock,
861867
}
862868

863869
_DOUBLE_SERIAL_COMMUNICATION_DOCK_TYPES = {
@@ -876,6 +882,9 @@ def get_supported_features(self) -> list[str]:
876882
RoborockDockTypeCode.f1s_dock,
877883
RoborockDockTypeCode.o7h_dock,
878884
RoborockDockTypeCode.f1c_dock,
885+
RoborockDockTypeCode.f1rc_dock,
886+
RoborockDockTypeCode.type_49_dock,
887+
RoborockDockTypeCode.f2rs_dock,
879888
}
880889

881890
_DOUBLE_SERIAL_COMMUNICATION_AM_DOCK_TYPES = {
@@ -887,19 +896,65 @@ def get_supported_features(self) -> list[str]:
887896
RoborockDockTypeCode.f1r_dock,
888897
RoborockDockTypeCode.f2r_dock,
889898
RoborockDockTypeCode.f1s_dock,
899+
RoborockDockTypeCode.type_49_dock,
900+
RoborockDockTypeCode.f2rs_dock,
890901
}
891902

892903
_SIMPLE_WASH_MODE_DOCK_TYPES = {
893904
RoborockDockTypeCode.f1_dock,
894905
RoborockDockTypeCode.f1r_dock,
895906
RoborockDockTypeCode.f2r_dock,
896907
RoborockDockTypeCode.f1c_dock,
908+
RoborockDockTypeCode.f1rc_dock,
909+
RoborockDockTypeCode.type_49_dock,
910+
RoborockDockTypeCode.f2rs_dock,
897911
}
898912

899913
_STEAM_WASH_DOCK_TYPES = {
900914
RoborockDockTypeCode.o7h_dock,
901915
}
902916

917+
_MULTI_CLEAN_FLUID_DOCK_TYPES = {
918+
RoborockDockTypeCode.shell_4s_dock,
919+
}
920+
921+
_CLEAN_CAROUSEL_DOCK_TYPES = {
922+
RoborockDockTypeCode.pearl_dock,
923+
RoborockDockTypeCode.pearl_plus_dock,
924+
RoborockDockTypeCode.shell_2s_dock,
925+
RoborockDockTypeCode.couple_dock,
926+
RoborockDockTypeCode.shell_3_dock,
927+
RoborockDockTypeCode.shell_2c_dock,
928+
RoborockDockTypeCode.shell_3s_dock,
929+
RoborockDockTypeCode.k1_dock,
930+
RoborockDockTypeCode.k1c_dock,
931+
RoborockDockTypeCode.k1s_dock,
932+
RoborockDockTypeCode.shell_e_dock,
933+
RoborockDockTypeCode.shell_2e_dock,
934+
RoborockDockTypeCode.shell_3c_dock,
935+
RoborockDockTypeCode.hera_dock,
936+
RoborockDockTypeCode.k1s_pro_dock,
937+
RoborockDockTypeCode.type_27_dock,
938+
RoborockDockTypeCode.k1c_lite_dock,
939+
RoborockDockTypeCode.k1r_dock,
940+
RoborockDockTypeCode.shell_2e_lite_dock,
941+
RoborockDockTypeCode.shell_4rc_dock,
942+
RoborockDockTypeCode.shell_4p_dock,
943+
RoborockDockTypeCode.shell_4s_dock,
944+
RoborockDockTypeCode.k1d_dock,
945+
RoborockDockTypeCode.shell_3p_dock,
946+
RoborockDockTypeCode.shell_4d_dock,
947+
RoborockDockTypeCode.shell_2e_heat_dock,
948+
RoborockDockTypeCode.f1_dock,
949+
RoborockDockTypeCode.f1r_dock,
950+
RoborockDockTypeCode.f2r_dock,
951+
RoborockDockTypeCode.f1s_dock,
952+
RoborockDockTypeCode.f1c_dock,
953+
RoborockDockTypeCode.f1rc_dock,
954+
RoborockDockTypeCode.type_49_dock,
955+
RoborockDockTypeCode.f2rs_dock,
956+
}
957+
903958

904959
@dataclass(frozen=True)
905960
class RoborockDockFeatures:
@@ -998,6 +1053,11 @@ def is_hatch_door_dock_cool_fan_supported(self) -> bool:
9981053

9991054
@property
10001055
def is_special_support_wash_temp(self) -> bool:
1056+
"""Whether the dock is a Shell 2E Lite.
1057+
1058+
The app's getter of the same name also depends on the product (true for every product except PearlEPro,
1059+
which needs a Shell 2E Lite dock). This dock-only property covers the dock part.
1060+
"""
10011061
return self.dock_type in _SPECIAL_WASH_TEMP_DOCK_TYPES
10021062

10031063
@property
@@ -1022,6 +1082,16 @@ def is_simple_wash_mode_supported(self) -> bool:
10221082
def is_steam_wash_supported(self) -> bool:
10231083
return self.dock_type in _STEAM_WASH_DOCK_TYPES
10241084

1085+
@property
1086+
def is_multi_clean_fluid_supported(self) -> bool:
1087+
"""Whether the dock supports the app's multi cleaning fluid feature (Shell 4S without AM)."""
1088+
return self._matches_non_am_variant(_MULTI_CLEAN_FLUID_DOCK_TYPES)
1089+
1090+
@property
1091+
def is_clean_carousel_supported(self) -> bool:
1092+
"""Whether the dock has a carousel (wash tray strainer) that needs cleaning as a consumable."""
1093+
return self.dock_type in _CLEAN_CAROUSEL_DOCK_TYPES
1094+
10251095

10261096
WASH_N_FILL_DOCK_TYPES = [
10271097
dock_type for dock_type in RoborockDockTypeCode if RoborockDockFeatures.from_dock_type(dock_type).is_washable

‎tests/test_supported_features.py‎

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ async def test_from_dict_rejects_legacy_missing_capabilities(caplog: pytest.LogC
338338
(RoborockDockTypeCode.o7h_dock, True, True),
339339
(RoborockDockTypeCode.f1c_dock, True, True),
340340
(RoborockDockTypeCode.type_49_dock, True, True),
341+
(RoborockDockTypeCode.f1rc_dock, True, True),
342+
(RoborockDockTypeCode.f2rs_dock, True, True),
341343
],
342344
)
343345
def test_dock_features(dock_type: RoborockDockTypeCode, is_collectable: bool, is_washable: bool) -> None:
@@ -358,7 +360,8 @@ def test_all_rr_api_dock_types_are_mapped() -> None:
358360
if dock_type is not RoborockDockTypeCode.unknown
359361
}
360362

361-
observed_docks = {49: "type_49_dock"} # P30 Pro; not present in the older RR_API snapshot.
363+
# Not present in the older RR_API snapshot: 49 seen on a P30 Pro; 48 and 50 from the newest V1 app plugins.
364+
observed_docks = {48: "f1rc_dock", 49: "type_49_dock", 50: "f2rs_dock"}
362365
assert mapped_docks == RR_API_DOCK_TYPES | observed_docks
363366

364367

@@ -431,6 +434,83 @@ def test_dock_feature_flags_with_am_variants_from_rr_api() -> None:
431434
assert shell_4rc_am.is_double_serial_communication_supported
432435

433436

437+
def test_dock_type_app_name_aliases() -> None:
438+
"""App dock names for codes that already had a placeholder member resolve to the same member."""
439+
assert RoborockDockTypeCode.shell_4_dock is RoborockDockTypeCode.type_27_dock
440+
assert RoborockDockTypeCode.f1rs_dock is RoborockDockTypeCode.type_49_dock
441+
assert RoborockDockTypeCode(27).name == "type_27_dock"
442+
assert RoborockDockTypeCode(49).name == "type_49_dock"
443+
assert RoborockDockTypeCode["f1rs_dock"] is RoborockDockTypeCode.type_49_dock
444+
assert "shell_4_dock" not in RoborockDockTypeCode.keys()
445+
assert "f1rs_dock" not in RoborockDockTypeCode.keys()
446+
447+
448+
# (dock type, has_am, capability, expected) from the DockConfigs table of the newest V1 app plugins.
449+
@pytest.mark.parametrize(
450+
("dock_type", "has_am", "capability", "expected"),
451+
[
452+
# F1RC (48): carousel self-clean only without AM, no water drain in either variant.
453+
(RoborockDockTypeCode.f1rc_dock, False, "is_collect_wash_dry", True),
454+
(RoborockDockTypeCode.f1rc_dock, False, "is_clean_carousel_self_clean_supported", True),
455+
(RoborockDockTypeCode.f1rc_dock, True, "is_clean_carousel_self_clean_supported", False),
456+
(RoborockDockTypeCode.f1rc_dock, False, "is_double_serial_communication_supported", True),
457+
(RoborockDockTypeCode.f1rc_dock, False, "is_high_tmp_water_supported", True),
458+
(RoborockDockTypeCode.f1rc_dock, False, "is_simple_wash_mode_supported", True),
459+
(RoborockDockTypeCode.f1rc_dock, False, "is_no_water_flow_carousel", False),
460+
(RoborockDockTypeCode.f1rc_dock, True, "is_water_updown_drain_supported", False),
461+
# F1RS (49) and F2RS (50): no-water-flow carousel, water drain only with AM.
462+
(RoborockDockTypeCode.f1rs_dock, False, "is_collect_wash_dry", True),
463+
(RoborockDockTypeCode.f1rs_dock, False, "is_clean_carousel_self_clean_supported", False),
464+
(RoborockDockTypeCode.f1rs_dock, False, "is_double_serial_communication_supported", True),
465+
(RoborockDockTypeCode.f1rs_dock, False, "is_high_tmp_water_supported", True),
466+
(RoborockDockTypeCode.f1rs_dock, False, "is_simple_wash_mode_supported", True),
467+
(RoborockDockTypeCode.f1rs_dock, False, "is_no_water_flow_carousel", True),
468+
(RoborockDockTypeCode.f1rs_dock, False, "is_water_updown_drain_supported", False),
469+
(RoborockDockTypeCode.f1rs_dock, True, "is_water_updown_drain_supported", True),
470+
(RoborockDockTypeCode.f2rs_dock, False, "is_collect_wash_dry", True),
471+
(RoborockDockTypeCode.f2rs_dock, False, "is_clean_carousel_self_clean_supported", False),
472+
(RoborockDockTypeCode.f2rs_dock, False, "is_double_serial_communication_supported", True),
473+
(RoborockDockTypeCode.f2rs_dock, False, "is_high_tmp_water_supported", True),
474+
(RoborockDockTypeCode.f2rs_dock, False, "is_simple_wash_mode_supported", True),
475+
(RoborockDockTypeCode.f2rs_dock, False, "is_no_water_flow_carousel", True),
476+
(RoborockDockTypeCode.f2rs_dock, False, "is_water_updown_drain_supported", False),
477+
(RoborockDockTypeCode.f2rs_dock, True, "is_water_updown_drain_supported", True),
478+
# The AM variants keep the code-only capabilities.
479+
(RoborockDockTypeCode.f1rc_dock, True, "is_high_tmp_water_supported", True),
480+
(RoborockDockTypeCode.f1rs_dock, True, "is_double_serial_communication_supported", True),
481+
(RoborockDockTypeCode.f2rs_dock, True, "is_simple_wash_mode_supported", True),
482+
# F2R (43): the newest app no longer offers carousel self-cleaning.
483+
(RoborockDockTypeCode.f2r_dock, False, "is_clean_carousel_self_clean_supported", False),
484+
(RoborockDockTypeCode.f1r_dock, False, "is_clean_carousel_self_clean_supported", False),
485+
(RoborockDockTypeCode.f1_dock, False, "is_clean_carousel_self_clean_supported", True),
486+
# K1S (20) gets automatic cleaning fluid delivery in both variants.
487+
(RoborockDockTypeCode.k1s_dock, False, "is_clean_fluid_auto_delivery_supported", True),
488+
(RoborockDockTypeCode.k1s_dock, True, "is_clean_fluid_auto_delivery_supported", True),
489+
(RoborockDockTypeCode.k1_dock, False, "is_clean_fluid_auto_delivery_supported", False),
490+
# Hera (24) has the hatch-door cool fan, like Couple.
491+
(RoborockDockTypeCode.hera_dock, True, "is_hatch_door_dock_cool_fan_supported", True),
492+
(RoborockDockTypeCode.couple_dock, True, "is_hatch_door_dock_cool_fan_supported", True),
493+
(RoborockDockTypeCode.shell_3_dock, True, "is_hatch_door_dock_cool_fan_supported", False),
494+
# Multiple cleaning fluids: Shell 4S (34) without AM only.
495+
(RoborockDockTypeCode.shell_4s_dock, False, "is_multi_clean_fluid_supported", True),
496+
(RoborockDockTypeCode.shell_4s_dock, True, "is_multi_clean_fluid_supported", False),
497+
(RoborockDockTypeCode.shell_4p_dock, False, "is_multi_clean_fluid_supported", False),
498+
# Carousel (strainer) present.
499+
(RoborockDockTypeCode.pearl_dock, False, "is_clean_carousel_supported", True),
500+
(RoborockDockTypeCode.shell_3s_dock, False, "is_clean_carousel_supported", True),
501+
(RoborockDockTypeCode.f1rc_dock, True, "is_clean_carousel_supported", True),
502+
(RoborockDockTypeCode.o4_dock, False, "is_clean_carousel_supported", False),
503+
(RoborockDockTypeCode.o7_dock, True, "is_clean_carousel_supported", False),
504+
(RoborockDockTypeCode.shell_4r_dock, False, "is_clean_carousel_supported", False),
505+
(RoborockDockTypeCode.o0_dock, False, "is_clean_carousel_supported", False),
506+
],
507+
)
508+
def test_dock_capabilities_from_app_dock_configs(
509+
dock_type: RoborockDockTypeCode, has_am: bool, capability: str, expected: bool
510+
) -> None:
511+
assert getattr(RoborockDockFeatures.from_dock_type(dock_type, has_am=has_am), capability) is expected
512+
513+
434514
@pytest.mark.parametrize(
435515
("device_filename"),
436516
list(mock_data.DEVICE_PRODUCT_PAIRS.keys()),

0 commit comments

Comments
 (0)