-
Notifications
You must be signed in to change notification settings - Fork 69
refactor(q10): harmonize enum state values across Q10 modes #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
lboue
wants to merge
3
commits into
Python-roborock:main
from
lboue:feat/q10-enum-value-harmonization
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,13 @@ | |
| import pytest | ||
|
|
||
| from roborock import HomeDataProduct, RoborockCategory | ||
| from roborock.data.b01_q10.b01_q10_code_mappings import B01_Q10_DP | ||
| from roborock.data.b01_q10.b01_q10_code_mappings import ( | ||
| B01_Q10_DP, | ||
| YXBackType, | ||
| YXDeviceCleanTask, | ||
| YXDeviceState, | ||
| YXDeviceWorkMode, | ||
| ) | ||
|
|
||
|
|
||
| def test_from_code() -> None: | ||
|
|
@@ -89,3 +95,29 @@ def test_homedata_product_unknown_category(): | |
| product = HomeDataProduct.from_dict(data) | ||
| assert product.id == "unknown_cat_id" | ||
| assert product.category == RoborockCategory.UNKNOWN | ||
|
|
||
|
|
||
| def test_yx_device_state_fault_uses_error_value() -> None: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure these tests are super meaningful, plus we'd probably want them in the q10 directory instead of randomly split across the two directories. Please just revert. |
||
| """Test YXDeviceState uses a cross-device-consistent error label.""" | ||
| assert YXDeviceState.FAULT_STATE.value == "error" | ||
|
|
||
|
|
||
| def test_yx_back_type_values_are_readable() -> None: | ||
| """Test YXBackType values are exposed as readable snake_case.""" | ||
| assert YXBackType.BACK_DUSTING.value == "back_dusting" | ||
| assert YXBackType.BACK_CHARGING.value == "back_charging" | ||
|
|
||
|
|
||
| def test_yx_device_work_mode_values_are_readable() -> None: | ||
| """Test YXDeviceWorkMode values align with readable cleaning labels.""" | ||
| assert YXDeviceWorkMode.BOTH_WORK.value == "vac_and_mop" | ||
| assert YXDeviceWorkMode.ONLY_SWEEP.value == "vacuum" | ||
| assert YXDeviceWorkMode.ONLY_MOP.value == "mop" | ||
| assert YXDeviceWorkMode.SAVE_WORRY.value == "save_worry" | ||
| assert YXDeviceWorkMode.SWEEP_MOP.value == "sweep_mop" | ||
|
|
||
|
|
||
| def test_yx_device_clean_task_values_are_readable() -> None: | ||
| """Test YXDeviceCleanTask values are exposed as readable snake_case.""" | ||
| assert YXDeviceCleanTask.DIVIDE_AREAS.value == "divide_areas" | ||
| assert YXDeviceCleanTask.CREATING_MAP.value == "creating_map" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.