Repository navigation
Conversation
Also cover code 105 on pure-mop soft-clean devices and SmartPlan codes without SmartPlan support.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #738
Fixes #977
Summary
SmartPlan and custom mode each set the fan speed, water and mop route together, and each can be chosen only as a cleaning mode. Before this change they were missing from the cleaning mode options on water-slide devices (#977), and they were offered as single values in the fan speed and mop route lists. Picking one of those single values sent one special code on its own and left the robot in a mixed state.
cleaning_mode_optionsofferscustomwhen the model supports custom mode (is_custom_mode_supported) and the device reportsis_customized_clean_supported. It offerssmart_mode(SmartPlan) when the device reportsis_smart_clean_mode_set_supported. Neither depends on the water mode list any more, so water-slide devices (e.g. Saros 10R) get both.current_cleaning_modechecks custom codes before SmartPlan codes, so mixed codes are reported as custom. It returnsNonewhen the detected mode is not one the device offers, instead of a value that is missing from the options.*_options,*_mapping) hold only values a user can select. SmartPlan codes (110 / 209 / 306) and custom codes (106 / 204 / 302) are no longer listed, so a value picked from these lists can never send a special code on its own.fan_speed_name,water_mode_nameandmop_route_namestill name the current value, including SmartPlan and custom codes, through the new publicget_fan_speed_name,get_water_mode_nameandget_mop_route_name.DeviceFeaturesmodel lists for custom mode and soft-clean mode were corrected (see Behavior changes).The mode conditions, the recognition order and the model lists were compared with the Roborock app plugin (V1, all plugin families). The cleaning mode options now match what the app shows for each model.
Behavior changes
fan_speed_options/fan_speed_mappingno longer containsmart_mode(110) orcustom(106).gentle, and only on soft-clean models (TanosV, TanosE, Tanos, RubySC, RubySLite, RubySE). Pure-mop models no longer listoff; mop-only cleaning is selected withcleaning_mode=mop. Other models no longer listgentle. In Home Assistant,vacuum.set_fan_speedwithoff,gentle,smart_modeorcustomwill fail withinvalid_fan_speedon those models.water_mode_options/water_mode_mappingandmop_route_options/mop_route_mappingno longer containsmart_mode(209 / 306) orcustom(204 / 302). Until Home Assistant handles this, its water and mop-route select entities will showunknownwhile the robot is in SmartPlan or custom mode.water_mode_namenow names 209 assmart_modeand 204 ascustom(it returnedNonebefore). On a soft-clean device that also supports pure mop, fan code 105 is namedgentle(it wasoffbefore).cleaning_mode_options:customis no longer offered on RubyPlus, RubySC and RubySE, soset_cleaning_mode("custom")raisesRoborockUnsupportedFeaturethere.smart_modeandcustomare now offered on water-slide devices.current_cleaning_mode: mixed custom and SmartPlan codes (e.g. 106 / 209 / 300) are nowcustom(they weresmart_mode). SmartPlan codes on a device without SmartPlan support, and custom codes on a model without custom mode, now giveNone.DeviceFeatures.is_soft_clean_mode_supportedis now True for RubySC, RubySLite and RubySE.DeviceFeatures.is_custom_mode_supportedis now False for RubyPlus, RubySC and RubySE.Conflicts with open PRs
I test-merged this branch against every open PR (
git merge-tree, on top of currentmain):roborock/data/v1/v1_clean_modes.py,tests/devices/traits/v1/test_status.pycustomandsmart_modeon water-slide devices depend only on the device flags. If #1025 lands first, this PR keeps its ownget_cleaning_mode_optionsand adapts #1025's parametrizedtest_cleaning_mode_options_water_slide_deviceto theis_custom_mode_supportedflag.CleaningMode.VAC_THEN_MOP)roborock/data/v1/v1_clean_modes.py,tests/devices/__snapshots__/test_v1_device.ambrget_cleaning_mode_options/get_current_cleaning_mode, so the rebase has to combine the option list and the recognition order by hand.tests/devices/__snapshots__/test_v1_device.ambrtests/__snapshots__/test_supported_features.ambrroborock/device_features.pyanddocs/V1_DEVICE_FEATURES.md, without a text conflict.Edits in the same files but without a text conflict: #1046, #1047 (
device_features.py,docs/V1_DEVICE_FEATURES.md,tests/test_supported_features.py), #1045, #1036 (docs/V1_DEVICE_FEATURES.md), #1030 (test_supported_features.ambr,test_status.py), #1026 (test_v1_device.ambr). The other open PRs touch none of this PR's files.Testing
pytest: full suite passes (2391 passed). Snapshots were updated only for the changed option lists and mappings.pre-commit run --all-files(ruff, mypy, codespell) passes.