From b6467d1763aa992244126a696e065df3d5126ce0 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Mon, 4 Sep 2023 14:12:53 +0200 Subject: [PATCH 1/9] feat add Q REVO support (RoborockFanSpeedP10 + RoborockMopModeP10) --- roborock/code_mappings.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index b148e1d..36b9bfa 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -172,6 +172,15 @@ class RoborockFanSpeedQ7Max(RoborockFanPowerCode): max = 104 +class RoborockFanSpeedP10(RoborockFanPowerCode): + off = 105 + quiet = 101 + balanced = 102 + turbo = 103 + max = 104 + max_plus = 108 + + class RoborockMopModeCode(RoborockEnum): """Describes the mop mode of the vacuum cleaner.""" @@ -193,6 +202,13 @@ class RoborockMopModeS8ProUltra(RoborockMopModeCode): custom = 302 +class RoborockMopModeP10(RoborockMopModeCode): + """Describes the mop mode of the vacuum cleaner.""" + + standard = 300 + fast = 304 + + class RoborockMopIntensityCode(RoborockEnum): """Describes the mop intensity of the vacuum cleaner.""" From 0f7b09c0239700027b8cace7e676d936699f7e77 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Mon, 4 Sep 2023 14:14:00 +0200 Subject: [PATCH 2/9] feat add Q REVO support (model ROBOROCK_P10/roborock.vacuum.a75) --- roborock/const.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roborock/const.py b/roborock/const.py index 9019b2f..dd6c788 100644 --- a/roborock/const.py +++ b/roborock/const.py @@ -33,6 +33,7 @@ ROBOROCK_C1 = "roborock.vacuum.c1" ROBOROCK_S8_PRO_ULTRA = "roborock.vacuum.a70" ROBOROCK_S8 = "roborock.vacuum.a51" +ROBOROCK_P10 = "roborock.vacuum.a75" SUPPORTED_VACUUMS = ( [ # These are the devices that show up when you add a device - more could be supported and just not show up @@ -51,5 +52,6 @@ ROBOROCK_S8, ROBOROCK_S4_MAX, ROBOROCK_S7, + ROBOROCK_P10, ] ) From 020523b97940350f0d2b653d5b408034f045f461 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Mon, 4 Sep 2023 14:16:36 +0200 Subject: [PATCH 3/9] feat add Q REVO support (P10Status) --- roborock/containers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roborock/containers.py b/roborock/containers.py index 2536f41..17945eb 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -20,12 +20,14 @@ RoborockFanSpeedS6Pure, RoborockFanSpeedS7, RoborockFanSpeedS7MaxV, + RoborockFanSpeedP10, RoborockMopIntensityCode, RoborockMopIntensityS7, RoborockMopIntensityV2, RoborockMopModeCode, RoborockMopModeS7, RoborockMopModeS8ProUltra, + RoborockMopModeP10, RoborockStateCode, ) from .const import ( @@ -42,6 +44,7 @@ ROBOROCK_S7_MAXV, ROBOROCK_S8, ROBOROCK_S8_PRO_ULTRA, + ROBOROCK_P10, SENSOR_DIRTY_REPLACE_TIME, SIDE_BRUSH_REPLACE_TIME, ) @@ -345,6 +348,13 @@ class S8Status(Status): mop_mode: Optional[RoborockMopModeS8ProUltra] = None +@dataclass +class P10Status(Status): + fan_power: Optional[RoborockFanSpeedP10] = None + water_box_mode: Optional[RoborockMopIntensityV2] = None + mop_mode: Optional[RoborockMopModeP10] = None + + ModelStatus: dict[str, Type[Status]] = { ROBOROCK_S4_MAX: S4MaxStatus, ROBOROCK_S5_MAX: S5MaxStatus, @@ -357,6 +367,7 @@ class S8Status(Status): ROBOROCK_S8: S8Status, ROBOROCK_S8_PRO_ULTRA: S8ProUltraStatus, ROBOROCK_G10S_PRO: S7MaxVStatus, + ROBOROCK_P10: P10Status } From 0ca3ca5b366e9754788b826c3e16f7704e2779d2 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Mon, 4 Sep 2023 17:41:37 +0200 Subject: [PATCH 4/9] feat add Q REVO support (status data) --- roborock/containers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roborock/containers.py b/roborock/containers.py index 17945eb..b4987f0 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -285,6 +285,16 @@ class Status(RoborockBase): charge_status: Optional[int] = None unsave_map_reason: Optional[int] = None unsave_map_flag: Optional[int] = None + wash_status: Optional[int] = None + distance_off: Optional[int] = None + in_warmup: Optional[int] = None + dry_status: Optional[int] = None + rdt: Optional[int] = None + clean_percent: Optional[int] = None + rss: Optional[int] = None + dss: Optional[int] = None + common_status: Optional[int] = None + corner_clean_mode: Optional[int] = None def __post_init__(self) -> None: self.square_meter_clean_area = round(self.clean_area / 1000000, 1) if self.clean_area is not None else None @@ -389,6 +399,7 @@ class CleanSummary(RoborockBase): clean_count: Optional[int] = None dust_collection_count: Optional[int] = None records: Optional[list[int]] = None + last_clean_t: Optional[int] = None def __post_init__(self) -> None: self.square_meter_clean_area = round(self.clean_area / 1000000, 1) if self.clean_area is not None else None From 63f9d65dbbeff12315464250a5029177f3d48997 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Mon, 4 Sep 2023 20:45:04 +0200 Subject: [PATCH 5/9] fix(P10Status): Change RoborockMopModeP10 by RoborockMopModeS8ProUltra --- roborock/containers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/roborock/containers.py b/roborock/containers.py index b4987f0..ef0c043 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -27,7 +27,6 @@ RoborockMopModeCode, RoborockMopModeS7, RoborockMopModeS8ProUltra, - RoborockMopModeP10, RoborockStateCode, ) from .const import ( @@ -362,7 +361,7 @@ class S8Status(Status): class P10Status(Status): fan_power: Optional[RoborockFanSpeedP10] = None water_box_mode: Optional[RoborockMopIntensityV2] = None - mop_mode: Optional[RoborockMopModeP10] = None + mop_mode: Optional[RoborockMopModeS8ProUltra] = None ModelStatus: dict[str, Type[Status]] = { @@ -377,7 +376,7 @@ class P10Status(Status): ROBOROCK_S8: S8Status, ROBOROCK_S8_PRO_ULTRA: S8ProUltraStatus, ROBOROCK_G10S_PRO: S7MaxVStatus, - ROBOROCK_P10: P10Status + ROBOROCK_P10: P10Status, } From 794d5a7daba2e6cb4f85c27d15a18f2f9e8119a1 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Mon, 4 Sep 2023 20:45:31 +0200 Subject: [PATCH 6/9] fix(RoborockMopModeP10): Remove --- roborock/code_mappings.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 36b9bfa..3d3ab46 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -202,13 +202,6 @@ class RoborockMopModeS8ProUltra(RoborockMopModeCode): custom = 302 -class RoborockMopModeP10(RoborockMopModeCode): - """Describes the mop mode of the vacuum cleaner.""" - - standard = 300 - fast = 304 - - class RoborockMopIntensityCode(RoborockEnum): """Describes the mop intensity of the vacuum cleaner.""" From 8518d2c638fbed3576cf5d5100d4a4f8b3214aa2 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 4 Sep 2023 16:22:47 -0400 Subject: [PATCH 7/9] fix: change ordering of imports --- roborock/containers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roborock/containers.py b/roborock/containers.py index ef0c043..a5fae84 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -16,11 +16,11 @@ RoborockDockWashTowelModeCode, RoborockErrorCode, RoborockFanPowerCode, + RoborockFanSpeedP10, RoborockFanSpeedQ7Max, RoborockFanSpeedS6Pure, RoborockFanSpeedS7, RoborockFanSpeedS7MaxV, - RoborockFanSpeedP10, RoborockMopIntensityCode, RoborockMopIntensityS7, RoborockMopIntensityV2, @@ -33,6 +33,7 @@ FILTER_REPLACE_TIME, MAIN_BRUSH_REPLACE_TIME, ROBOROCK_G10S_PRO, + ROBOROCK_P10, ROBOROCK_Q7_MAX, ROBOROCK_S4_MAX, ROBOROCK_S5_MAX, @@ -43,7 +44,6 @@ ROBOROCK_S7_MAXV, ROBOROCK_S8, ROBOROCK_S8_PRO_ULTRA, - ROBOROCK_P10, SENSOR_DIRTY_REPLACE_TIME, SIDE_BRUSH_REPLACE_TIME, ) From e35c62d28ddfdff094b6dd570c825c67e484ad39 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Wed, 6 Sep 2023 15:54:44 +0200 Subject: [PATCH 8/9] fix: change q_revo->p10 to be consistent with entire code --- roborock/code_mappings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 3d3ab46..fb5ed51 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -245,7 +245,7 @@ class RoborockDockTypeCode(RoborockEnum): auto_empty_dock_pure = 5 s7_max_ultra_dock = 6 s8_dock = 7 - q_revo = 8 + p10_dock = 8 class RoborockDockDustCollectionModeCode(RoborockEnum): From 7aa24e7116d8e1cbc996a1d5021e8f5f71120574 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Wed, 6 Sep 2023 15:58:20 +0200 Subject: [PATCH 9/9] fix: for HA component(items: dock_mop_wash_mode_interval, dock_washing_mode) stuck at "unknow" value when using P10 --- roborock/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roborock/api.py b/roborock/api.py index 59bf24c..de5aa1c 100644 --- a/roborock/api.py +++ b/roborock/api.py @@ -75,6 +75,11 @@ RoborockCommand.GET_MULTI_MAP, ] RT = TypeVar("RT", bound=RoborockBase) +WASH_N_FILL_DOCK = [ + RoborockDockTypeCode.empty_wash_fill_dock, + RoborockDockTypeCode.s8_dock, + RoborockDockTypeCode.p10_dock, +] def md5hex(message: str) -> str: @@ -454,7 +459,7 @@ async def get_dock_summary(self, dock_type: RoborockDockTypeCode) -> DockSummary DustCollectionMode | WashTowelMode | SmartWashParams | None, ] ] = [self.get_dust_collection_mode()] - if dock_type == RoborockDockTypeCode.empty_wash_fill_dock or dock_type == RoborockDockTypeCode.s8_dock: + if dock_type in WASH_N_FILL_DOCK: commands += [ self.get_wash_towel_mode(), self.get_smart_wash_params(),