From 49ad8f3443862468eddf46532a6a3dbf070a52e7 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 23 Sep 2023 21:54:18 -0400 Subject: [PATCH 1/2] fix: add custom code for p10 --- roborock/code_mappings.py | 11 +++++++++++ roborock/containers.py | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 75731e5..8f1758e 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -178,6 +178,7 @@ class RoborockFanSpeedP10(RoborockFanPowerCode): balanced = 102 turbo = 103 max = 104 + custom = 106 max_plus = 108 @@ -225,6 +226,16 @@ class RoborockMopIntensityV2(RoborockMopIntensityCode): high = 203 custom = 207 +class RoborockMopIntensityP10(RoborockMopIntensityCode): + """Describes the mop intensity of the vacuum cleaner.""" + + off = 200 + low = 201 + medium = 202 + high = 203 + custom = 204 + + class RoborockMopIntensityS5Max(RoborockMopIntensityCode): """Describes the mop intensity of the vacuum cleaner.""" diff --git a/roborock/containers.py b/roborock/containers.py index 0082181..1429b95 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -29,7 +29,7 @@ RoborockMopModeCode, RoborockMopModeS7, RoborockMopModeS8ProUltra, - RoborockStateCode, + RoborockStateCode, RoborockMopIntensityP10, ) from .const import ( FILTER_REPLACE_TIME, @@ -362,7 +362,7 @@ class S8Status(Status): @dataclass class P10Status(Status): fan_power: RoborockFanSpeedP10 | None = None - water_box_mode: RoborockMopIntensityV2 | None = None + water_box_mode: RoborockMopIntensityP10 | None = None mop_mode: RoborockMopModeS8ProUltra | None = None From e3c7fab16e41926b428eefdff7e35fd86eb2b933 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 23 Sep 2023 22:04:15 -0400 Subject: [PATCH 2/2] chore: lint --- roborock/code_mappings.py | 2 +- roborock/containers.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/roborock/code_mappings.py b/roborock/code_mappings.py index 8f1758e..eab7fc5 100644 --- a/roborock/code_mappings.py +++ b/roborock/code_mappings.py @@ -226,6 +226,7 @@ class RoborockMopIntensityV2(RoborockMopIntensityCode): high = 203 custom = 207 + class RoborockMopIntensityP10(RoborockMopIntensityCode): """Describes the mop intensity of the vacuum cleaner.""" @@ -236,7 +237,6 @@ class RoborockMopIntensityP10(RoborockMopIntensityCode): custom = 204 - class RoborockMopIntensityS5Max(RoborockMopIntensityCode): """Describes the mop intensity of the vacuum cleaner.""" diff --git a/roborock/containers.py b/roborock/containers.py index 1429b95..7a8c89a 100644 --- a/roborock/containers.py +++ b/roborock/containers.py @@ -23,13 +23,14 @@ RoborockFanSpeedS7, RoborockFanSpeedS7MaxV, RoborockMopIntensityCode, + RoborockMopIntensityP10, RoborockMopIntensityS5Max, RoborockMopIntensityS7, RoborockMopIntensityV2, RoborockMopModeCode, RoborockMopModeS7, RoborockMopModeS8ProUltra, - RoborockStateCode, RoborockMopIntensityP10, + RoborockStateCode, ) from .const import ( FILTER_REPLACE_TIME,