Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions roborock/data/b01_q7/b01_q7_code_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions tests/devices/traits/b01/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ async def test_q7_api_query_values(q7_api: Q7PropertiesApi, fake_channel: FakeCh

# 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,
}

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

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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ 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"

Expand Down
Loading