Skip to content

Commit a6de89e

Browse files
author
anotherdave
committed
#392 fix wind and water mappings for Q7
Based on actual values sent by Android app 4.54.02, robot firmware V03.01.71
1 parent 080d673 commit a6de89e

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

roborock/data/b01_q7/b01_q7_code_mappings.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +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)
35-
33+
LOW = ("low", 1)
34+
MEDIUM = ("medium", 2)
35+
HIGH = ("high", 3)
3636

3737
class CleanTypeMapping(RoborockModeEnum):
3838
"""Maps the type of cleaning (Vacuum, Mop, or both)."""

tests/devices/traits/b01/test_init.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ async def test_q7_api_query_values(q7_api: Q7PropertiesApi, fake_channel: FakeCh
6060

6161
# We need to construct the expected result based on the mappings
6262
# status: 1 -> WAITING_FOR_ORDERS
63-
# wind: 1 -> STANDARD
63+
# wind: 2 -> STANDARD
6464
response_data = {
6565
"status": 1,
66-
"wind": 1,
66+
"wind": 2,
6767
"battery": 100,
6868
}
6969

@@ -81,10 +81,10 @@ async def test_q7_api_query_values(q7_api: Q7PropertiesApi, fake_channel: FakeCh
8181

8282
assert result is not None
8383
assert result.status == WorkStatusMapping.WAITING_FOR_ORDERS
84-
# wind might be mapped to SCWindMapping.STANDARD (1)
84+
# wind might be mapped to SCWindMapping.STANDARD (2)
8585
# let's verify checking the prop definition in B01Props
8686
# wind: SCWindMapping | None = None
87-
# SCWindMapping.STANDARD is 1 ('balanced')
87+
# SCWindMapping.STANDARD is 2 ('balanced')
8888
from roborock.data.b01_q7 import SCWindMapping
8989

9090
assert result.wind == SCWindMapping.STANDARD

tests/test_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def test_b01props_deserialization():
468468
assert isinstance(deserialized, B01Props)
469469
assert deserialized.fault == B01Fault.F_510
470470
assert deserialized.status == WorkStatusMapping.SWEEP_MOPING_2
471-
assert deserialized.wind == SCWindMapping.SUPER_STRONG
471+
assert deserialized.wind == SCWindMapping.STRONG
472472
assert deserialized.net_status is not None
473473
assert deserialized.net_status.ip == "192.168.1.102"
474474

0 commit comments

Comments
 (0)