From b6467d1763aa992244126a696e065df3d5126ce0 Mon Sep 17 00:00:00 2001 From: jalcaras Date: Mon, 4 Sep 2023 14:12:53 +0200 Subject: [PATCH 1/7] 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/7] 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/7] 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/7] 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/7] 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/7] 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/7] 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, )