From b0ba0ff90d6c0ca674824e7298620b8980046977 Mon Sep 17 00:00:00 2001 From: anotherdave Date: Mon, 29 Dec 2025 09:35:24 -0500 Subject: [PATCH 1/2] 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 --- roborock/data/b01_q7/b01_q7_code_mappings.py | 15 ++++++++------- tests/devices/traits/b01/q7/test_init.py | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/roborock/data/b01_q7/b01_q7_code_mappings.py b/roborock/data/b01_q7/b01_q7_code_mappings.py index c0912beb..857b0ca3 100644 --- a/roborock/data/b01_q7/b01_q7_code_mappings.py +++ b/roborock/data/b01_q7/b01_q7_code_mappings.py @@ -20,18 +20,19 @@ class WorkStatusMapping(RoborockModeEnum): class SCWindMapping(RoborockModeEnum): """Maps suction power levels.""" - SILENCE = ("quiet", 0) - STANDARD = ("balanced", 1) - STRONG = ("turbo", 2) - SUPER_STRONG = ("max", 3) + SILENCE = ("quiet", 1) + STANDARD = ("balanced", 2) + STRONG = ("turbo", 3) + SUPER_STRONG = ("max", 4) + SUPER_STRONG_PLUS = ("max_plus", 5) class WaterLevelMapping(RoborockModeEnum): """Maps water flow levels.""" - LOW = ("low", 0) - MEDIUM = ("medium", 1) - HIGH = ("high", 2) + LOW = ("low", 1) + MEDIUM = ("medium", 2) + HIGH = ("high", 3) class CleanTypeMapping(RoborockModeEnum): diff --git a/tests/devices/traits/b01/q7/test_init.py b/tests/devices/traits/b01/q7/test_init.py index 39acbb53..50096a5a 100644 --- a/tests/devices/traits/b01/q7/test_init.py +++ b/tests/devices/traits/b01/q7/test_init.py @@ -93,10 +93,10 @@ async def test_q7_api_query_values( """Test that Q7PropertiesApi correctly converts raw values.""" # We need to construct the expected result based on the mappings # status: 1 -> WAITING_FOR_ORDERS - # wind: 1 -> STANDARD + # wind: 2 -> STANDARD response_data = { "status": 1, - "wind": 1, + "wind": 2, "battery": 100, } @@ -112,10 +112,10 @@ async def test_q7_api_query_values( assert result is not None assert result.status == WorkStatusMapping.WAITING_FOR_ORDERS - # wind might be mapped to SCWindMapping.STANDARD (1) + # wind might be mapped to SCWindMapping.STANDARD (2) # let's verify checking the prop definition in B01Props # wind: SCWindMapping | None = None - # SCWindMapping.STANDARD is 1 ('balanced') + # SCWindMapping.STANDARD is 2 ('balanced') from roborock.data.b01_q7 import SCWindMapping assert result.wind == SCWindMapping.STANDARD From cfce1dd04c85ae502069f2b0e52cd40a3fce3c56 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 29 Dec 2025 10:00:58 -0500 Subject: [PATCH 2/2] fix: test --- tests/data/b01_q7/test_b01_q7_containers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/b01_q7/test_b01_q7_containers.py b/tests/data/b01_q7/test_b01_q7_containers.py index a312bd03..de5b108f 100644 --- a/tests/data/b01_q7/test_b01_q7_containers.py +++ b/tests/data/b01_q7/test_b01_q7_containers.py @@ -99,6 +99,6 @@ def test_b01props_deserialization(): assert isinstance(deserialized, B01Props) assert deserialized.fault == B01Fault.F_510 assert deserialized.status == WorkStatusMapping.SWEEP_MOPING_2 - assert deserialized.wind == SCWindMapping.SUPER_STRONG + assert deserialized.wind == SCWindMapping.STRONG assert deserialized.net_status is not None assert deserialized.net_status.ip == "192.168.1.102"