Skip to content

Commit

Permalink
feat: add support for qrevo curv (#253)
Browse files Browse the repository at this point in the history
* add support for qrevo curv

* add dock support

* revert unnecessary changes

* fix: lint

---------

Co-authored-by: Luke Lashley <[email protected]>
  • Loading branch information
Christopher-Masselli and Lash-L authored Jan 9, 2025
1 parent 2d24a66 commit e42729a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
27 changes: 27 additions & 0 deletions roborock/code_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,15 @@ class RoborockFanSpeedQRevoMaster(RoborockFanPowerCode):
smart_mode = 110


class RoborockFanSpeedQRevoCurv(RoborockFanPowerCode):
quiet = 101
balanced = 102
turbo = 103
max = 104
max_plus = 105
smart_mode = 110


class RoborockFanSpeedP10(RoborockFanPowerCode):
off = 105
quiet = 101
Expand All @@ -279,6 +288,14 @@ 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."""

Expand Down Expand Up @@ -351,6 +368,15 @@ class RoborockMopIntensityQRevoMaster(RoborockMopIntensityCode):
smart_mode = 209


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."""

Expand Down Expand Up @@ -431,6 +457,7 @@ class RoborockDockTypeCode(RoborockEnum):
s8_maxv_ultra_dock = 10
qrevo_master_dock = 14
qrevo_s_dock = 15
qrevo_curv_dock = 17


class RoborockDockDustCollectionModeCode(RoborockEnum):
Expand Down
1 change: 1 addition & 0 deletions roborock/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 12 additions & 0 deletions roborock/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
RoborockFanPowerCode,
RoborockFanSpeedP10,
RoborockFanSpeedQ7Max,
RoborockFanSpeedQRevoCurv,
RoborockFanSpeedQRevoMaster,
RoborockFanSpeedS6Pure,
RoborockFanSpeedS7,
Expand All @@ -30,12 +31,14 @@
RoborockMopIntensityCode,
RoborockMopIntensityP10,
RoborockMopIntensityQ7Max,
RoborockMopIntensityQRevoCurv,
RoborockMopIntensityQRevoMaster,
RoborockMopIntensityS5Max,
RoborockMopIntensityS6MaxV,
RoborockMopIntensityS7,
RoborockMopIntensityS8MaxVUltra,
RoborockMopModeCode,
RoborockMopModeQRevoCurv,
RoborockMopModeQRevoMaster,
RoborockMopModeS7,
RoborockMopModeS8MaxVUltra,
Expand All @@ -52,6 +55,7 @@
ROBOROCK_G10S_PRO,
ROBOROCK_P10,
ROBOROCK_Q7_MAX,
ROBOROCK_QREVO_CURV,
ROBOROCK_QREVO_MASTER,
ROBOROCK_QREVO_MAXV,
ROBOROCK_QREVO_PRO,
Expand Down Expand Up @@ -581,6 +585,13 @@ class QRevoMasterStatus(Status):
mop_mode: RoborockMopModeQRevoMaster | 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
Expand Down Expand Up @@ -639,6 +650,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,
Expand Down
1 change: 1 addition & 0 deletions roborock/version_1_apis/roborock_client_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e42729a

Please sign in to comment.