From 9e03290ebba07ccb3b7e545b4ffa1f8865618c12 Mon Sep 17 00:00:00 2001 From: "christopher-masselli@gmail.com" Date: Mon, 2 Dec 2024 21:13:00 -0500 Subject: [PATCH 1/4] add support for qrevo curv --- roborock/code_mappings.py | 22 ++++++++++++++++++++-- roborock/const.py | 1 + roborock/containers.py | 10 ++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 8bd58b4..77f112d 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -251,6 +251,13 @@ class RoborockFanSpeedQRevoMaster(RoborockFanPowerCode): max_plus = 105 custom = 110 # Smartplan +class RoborockFanSpeedQRevoCurv(RoborockFanPowerCode): + quiet = 101 + balanced = 102 + turbo = 103 + max = 104 + max_plus = 105 + smart_mode = 110 class RoborockFanSpeedP10(RoborockFanPowerCode): off = 105 @@ -276,10 +283,14 @@ class RoborockFanSpeedS8MaxVUltra(RoborockFanPowerCode): class RoborockMopModeCode(RoborockEnum): """Describes the mop mode of the vacuum cleaner.""" +class RoborockMopModeQRevoCurv(RoborockMopModeCode): + standard = 300 + deep = 301 + deep_plus = 303 + fast = 304 + smart_mode = 306 class RoborockMopModeS7(RoborockMopModeCode): - """Describes the mop mode of the vacuum cleaner.""" - standard = 300 deep = 301 custom = 302 @@ -338,6 +349,13 @@ class RoborockMopIntensityQRevoMaster(RoborockMopIntensityCode): custom_water_flow = 207 custom = 209 # SmartPlan +class RoborockMopIntensityQRevoCurv(RoborockMopIntensityCode): + off = 200 + low = 201 + medium = 202 + high = 203 + custom_water_flow = 207 + smart_mode = 209 class RoborockMopIntensityP10(RoborockMopIntensityCode): """Describes the mop intensity of the vacuum cleaner.""" diff --git a/roborock/const.py b/roborock/const.py index e274250..e15f086 100644 --- a/roborock/const.py +++ b/roborock/const.py @@ -31,6 +31,7 @@ ROBOROCK_Q7_MAX = "roborock.vacuum.a38" ROBOROCK_Q7PLUS = "roborock.vacuum.a40" ROBOROCK_QREVO_MASTER = "roborock.vacuum.a117" +ROBOROCK_QREVO_CURV = "roborock.vacuum.a135" ROBOROCK_Q8_MAX = "roborock.vacuum.a73" ROBOROCK_G10S_PRO = "roborock.vacuum.a26" ROBOROCK_G10S = "roborock.vacuum.a46" diff --git a/roborock/containers.py b/roborock/containers.py index 18f2a19..b20e4ac 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -21,6 +21,7 @@ RoborockFanSpeedP10, RoborockFanSpeedQ7Max, RoborockFanSpeedQRevoMaster, + RoborockFanSpeedQRevoCurv, RoborockFanSpeedS6Pure, RoborockFanSpeedS7, RoborockFanSpeedS7MaxV, @@ -31,11 +32,13 @@ RoborockMopIntensityP10, RoborockMopIntensityQ7Max, RoborockMopIntensityQRevoMaster, + RoborockMopIntensityQRevoCurv, RoborockMopIntensityS5Max, RoborockMopIntensityS6MaxV, RoborockMopIntensityS7, RoborockMopIntensityS8MaxVUltra, RoborockMopModeCode, + RoborockMopModeQRevoCurv, RoborockMopModeS7, RoborockMopModeS8MaxVUltra, RoborockMopModeS8ProUltra, @@ -52,6 +55,7 @@ ROBOROCK_P10, ROBOROCK_Q7_MAX, ROBOROCK_QREVO_MASTER, + ROBOROCK_QREVO_CURV, ROBOROCK_QREVO_MAXV, ROBOROCK_QREVO_PRO, ROBOROCK_QREVO_S, @@ -578,6 +582,11 @@ class QRevoMasterStatus(Status): fan_power: RoborockFanSpeedQRevoMaster | None = None water_box_mode: RoborockMopIntensityQRevoMaster | None = None +@dataclass +class QRevoCurvStatus(Status): + fan_power: RoborockFanSpeedQRevoCurv | None = None + water_box_mode: RoborockMopIntensityQRevoCurv | None = None + mop_mode: RoborockMopModeQRevoCurv | None = None @dataclass class S6MaxVStatus(Status): @@ -637,6 +646,7 @@ class S8MaxvUltraStatus(Status): ROBOROCK_S5_MAX: S5MaxStatus, ROBOROCK_Q7_MAX: Q7MaxStatus, ROBOROCK_QREVO_MASTER: QRevoMasterStatus, + ROBOROCK_QREVO_CURV: QRevoCurvStatus, ROBOROCK_S6: S6PureStatus, ROBOROCK_S6_MAXV: S6MaxVStatus, ROBOROCK_S6_PURE: S6PureStatus, From 2779acdef58a66a3e5be993d799fd3478ddef438 Mon Sep 17 00:00:00 2001 From: "christopher-masselli@gmail.com" Date: Mon, 2 Dec 2024 22:03:45 -0500 Subject: [PATCH 2/4] add dock support --- roborock/code_mappings.py | 1 + roborock/version_1_apis/roborock_client_v1.py | 1 + 2 files changed, 2 insertions(+) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 77f112d..8270afa 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -436,6 +436,7 @@ class RoborockDockTypeCode(RoborockEnum): p10_pro_dock = 9 s8_maxv_ultra_dock = 10 qrevo_s_dock = 15 + qrevo_curv_dock = 17 class RoborockDockDustCollectionModeCode(RoborockEnum): diff --git a/roborock/version_1_apis/roborock_client_v1.py b/roborock/version_1_apis/roborock_client_v1.py index 279721e..c0fe641 100644 --- a/roborock/version_1_apis/roborock_client_v1.py +++ b/roborock/version_1_apis/roborock_client_v1.py @@ -71,6 +71,7 @@ RoborockDockTypeCode.p10_pro_dock, RoborockDockTypeCode.s8_maxv_ultra_dock, RoborockDockTypeCode.qrevo_s_dock, + RoborockDockTypeCode.qrevo_curv_dock, ] RT = TypeVar("RT", bound=RoborockBase) EVICT_TIME = 60 From 99a60e15a0016d5638cf49cfd7130d84fe930d0d Mon Sep 17 00:00:00 2001 From: "christopher-masselli@gmail.com" Date: Mon, 2 Dec 2024 22:11:15 -0500 Subject: [PATCH 3/4] revert unnecessary changes --- roborock/code_mappings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 8270afa..180a17d 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -291,6 +291,8 @@ class RoborockMopModeQRevoCurv(RoborockMopModeCode): smart_mode = 306 class RoborockMopModeS7(RoborockMopModeCode): + """Describes the mop mode of the vacuum cleaner.""" + standard = 300 deep = 301 custom = 302 From eb415ea9e704bcad6e9ea3f1c24e1b5dbbffea58 Mon Sep 17 00:00:00 2001 From: Luke Lashley Date: Tue, 7 Jan 2025 23:20:49 -0500 Subject: [PATCH 4/4] fix: lint --- roborock/code_mappings.py | 6 ++++++ roborock/containers.py | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 180a17d..3f756f9 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -251,6 +251,7 @@ class RoborockFanSpeedQRevoMaster(RoborockFanPowerCode): max_plus = 105 custom = 110 # Smartplan + class RoborockFanSpeedQRevoCurv(RoborockFanPowerCode): quiet = 101 balanced = 102 @@ -259,6 +260,7 @@ class RoborockFanSpeedQRevoCurv(RoborockFanPowerCode): max_plus = 105 smart_mode = 110 + class RoborockFanSpeedP10(RoborockFanPowerCode): off = 105 quiet = 101 @@ -283,6 +285,7 @@ class RoborockFanSpeedS8MaxVUltra(RoborockFanPowerCode): class RoborockMopModeCode(RoborockEnum): """Describes the mop mode of the vacuum cleaner.""" + class RoborockMopModeQRevoCurv(RoborockMopModeCode): standard = 300 deep = 301 @@ -290,6 +293,7 @@ class RoborockMopModeQRevoCurv(RoborockMopModeCode): fast = 304 smart_mode = 306 + class RoborockMopModeS7(RoborockMopModeCode): """Describes the mop mode of the vacuum cleaner.""" @@ -351,6 +355,7 @@ class RoborockMopIntensityQRevoMaster(RoborockMopIntensityCode): custom_water_flow = 207 custom = 209 # SmartPlan + class RoborockMopIntensityQRevoCurv(RoborockMopIntensityCode): off = 200 low = 201 @@ -359,6 +364,7 @@ class RoborockMopIntensityQRevoCurv(RoborockMopIntensityCode): custom_water_flow = 207 smart_mode = 209 + class RoborockMopIntensityP10(RoborockMopIntensityCode): """Describes the mop intensity of the vacuum cleaner.""" diff --git a/roborock/containers.py b/roborock/containers.py index b20e4ac..a9294be 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -20,8 +20,8 @@ RoborockFanPowerCode, RoborockFanSpeedP10, RoborockFanSpeedQ7Max, - RoborockFanSpeedQRevoMaster, RoborockFanSpeedQRevoCurv, + RoborockFanSpeedQRevoMaster, RoborockFanSpeedS6Pure, RoborockFanSpeedS7, RoborockFanSpeedS7MaxV, @@ -31,8 +31,8 @@ RoborockMopIntensityCode, RoborockMopIntensityP10, RoborockMopIntensityQ7Max, - RoborockMopIntensityQRevoMaster, RoborockMopIntensityQRevoCurv, + RoborockMopIntensityQRevoMaster, RoborockMopIntensityS5Max, RoborockMopIntensityS6MaxV, RoborockMopIntensityS7, @@ -54,8 +54,8 @@ ROBOROCK_G10S_PRO, ROBOROCK_P10, ROBOROCK_Q7_MAX, - ROBOROCK_QREVO_MASTER, ROBOROCK_QREVO_CURV, + ROBOROCK_QREVO_MASTER, ROBOROCK_QREVO_MAXV, ROBOROCK_QREVO_PRO, ROBOROCK_QREVO_S, @@ -582,12 +582,14 @@ class QRevoMasterStatus(Status): fan_power: RoborockFanSpeedQRevoMaster | None = None water_box_mode: RoborockMopIntensityQRevoMaster | None = None + @dataclass class QRevoCurvStatus(Status): fan_power: RoborockFanSpeedQRevoCurv | None = None water_box_mode: RoborockMopIntensityQRevoCurv | None = None mop_mode: RoborockMopModeQRevoCurv | None = None + @dataclass class S6MaxVStatus(Status): fan_power: RoborockFanSpeedS7MaxV | None = None