Skip to content

Commit b0ba0ff

Browse files
anotherdaveanotherdave
authored andcommitted
fix: fix wind and water mappings for Q7 (#715)
* #392 fix wind and water mappings for Q7 Based on actual values sent by Android app 4.54.02, robot firmware V03.01.71 * Fix lint --------- Co-authored-by: anotherdave <anotherdave@no-reply.github.com>
1 parent 1ea14a4 commit b0ba0ff

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

roborock/data/b01_q7/b01_q7_code_mappings.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ class WorkStatusMapping(RoborockModeEnum):
2020
class SCWindMapping(RoborockModeEnum):
2121
"""Maps suction power levels."""
2222

23-
SILENCE = ("quiet", 0)
24-
STANDARD = ("balanced", 1)
25-
STRONG = ("turbo", 2)
26-
SUPER_STRONG = ("max", 3)
23+
SILENCE = ("quiet", 1)
24+
STANDARD = ("balanced", 2)
25+
STRONG = ("turbo", 3)
26+
SUPER_STRONG = ("max", 4)
27+
SUPER_STRONG_PLUS = ("max_plus", 5)
2728

2829

2930
class WaterLevelMapping(RoborockModeEnum):
3031
"""Maps water flow levels."""
3132

32-
LOW = ("low", 0)
33-
MEDIUM = ("medium", 1)
34-
HIGH = ("high", 2)
33+
LOW = ("low", 1)
34+
MEDIUM = ("medium", 2)
35+
HIGH = ("high", 3)
3536

3637

3738
class CleanTypeMapping(RoborockModeEnum):

tests/devices/traits/b01/q7/test_init.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ async def test_q7_api_query_values(
9393
"""Test that Q7PropertiesApi correctly converts raw values."""
9494
# We need to construct the expected result based on the mappings
9595
# status: 1 -> WAITING_FOR_ORDERS
96-
# wind: 1 -> STANDARD
96+
# wind: 2 -> STANDARD
9797
response_data = {
9898
"status": 1,
99-
"wind": 1,
99+
"wind": 2,
100100
"battery": 100,
101101
}
102102

@@ -112,10 +112,10 @@ async def test_q7_api_query_values(
112112

113113
assert result is not None
114114
assert result.status == WorkStatusMapping.WAITING_FOR_ORDERS
115-
# wind might be mapped to SCWindMapping.STANDARD (1)
115+
# wind might be mapped to SCWindMapping.STANDARD (2)
116116
# let's verify checking the prop definition in B01Props
117117
# wind: SCWindMapping | None = None
118-
# SCWindMapping.STANDARD is 1 ('balanced')
118+
# SCWindMapping.STANDARD is 2 ('balanced')
119119
from roborock.data.b01_q7 import SCWindMapping
120120

121121
assert result.wind == SCWindMapping.STANDARD

0 commit comments

Comments
 (0)