Skip to content

Commit 08ca9aa

Browse files
authored
feat: Rename and reorder YXFanLevel enum members (#787)
* chore: Rename and reorder `YXFanLevel` enum members * chore: Fix MAX_PLUS enum value * docs: Add docstring and alias comments to the YXFanLevel enum. * chore: fix lint.
1 parent b0fc1c7 commit 08ca9aa

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

roborock/data/b01_q10/b01_q10_code_mappings.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,19 @@ class B01_Q10_DP(RoborockModeEnum):
119119

120120

121121
class YXFanLevel(RoborockModeEnum):
122+
"""The fan or vacuum level of the robot.
123+
124+
Note: The names used here are the v1 names, though the values
125+
have different aliases in the app bundles.
126+
"""
127+
122128
UNKNOWN = "unknown", -1
123-
CLOSE = "close", 0
129+
OFF = "off", 0 # close
124130
QUIET = "quiet", 1
125-
NORMAL = "normal", 2
126-
STRONG = "strong", 3
131+
BALANCED = "balanced", 2 # normal
132+
TURBO = "turbo", 3 # strong
127133
MAX = "max", 4
128-
SUPER = "super", 8
134+
MAX_PLUS = "max_plus", 8 # super
129135

130136

131137
class YXWaterLevel(RoborockModeEnum):

tests/devices/traits/b01/q10/test_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ async def test_status_trait_refresh(
139139
# Verify trait attributes are updated
140140
assert q10_api.status.battery == 100
141141
assert q10_api.status.status == YXDeviceState.CHARGING_STATE
142-
assert q10_api.status.fan_level == YXFanLevel.NORMAL
142+
assert q10_api.status.fan_level == YXFanLevel.BALANCED
143143

144144

145145
def test_status_trait_update_listener(q10_api: Q10PropertiesApi) -> None:

tests/devices/traits/b01/q10/test_vacuum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def vacuumm_fixture(q10_api: Q10PropertiesApi) -> VacuumTrait:
3535
(lambda x: x.return_to_dock(), {"203": {}}),
3636
(lambda x: x.empty_dustbin(), {"203": 2}),
3737
(lambda x: x.set_clean_mode(YXCleanType.BOTH_WORK), {"137": 1}),
38-
(lambda x: x.set_fan_level(YXFanLevel.NORMAL), {"123": 2}),
38+
(lambda x: x.set_fan_level(YXFanLevel.BALANCED), {"123": 2}),
3939
],
4040
)
4141
async def test_vacuum_commands(

0 commit comments

Comments
 (0)