Skip to content

feat: add better dock feature control - #867

Merged
Lash-L merged 5 commits into
mainfrom
roborock_dock_features
Jul 8, 2026
Merged

feat: add better dock feature control#867
Lash-L merged 5 commits into
mainfrom
roborock_dock_features

Conversation

@Lash-L

Copy link
Copy Markdown
Collaborator

Replaces: #866#865

This adds more intelligent feature flag control than what we currently have been doing for dock related features. matches our other device features work.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors V1 dock-related trait gating to use a centralized dock-capabilities model (RoborockDockFeatures) derived from RoborockDockTypeCode, and updates tests accordingly.

Changes:

  • Introduces RoborockDockFeatures and updates V1 traits to gate by requires_dock_features rather than dock-type membership lists.
  • Renames/re-maps RoborockDockTypeCode members to a new naming scheme and adjusts container/tests to match.
  • Expands/normalizes trait test parametrization to cover capability-based dock support.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
tests/test_supported_features.pyAdds coverage for RoborockDockFeatures capability flags and AM-variant behavior.
tests/devices/traits/v1/test_wash_towel_mode.pySwitches parametrization to capability-based dock support; updates specific dock types used in tests.
tests/devices/traits/v1/test_smart_wash_params.pySwitches parametrization to capability-based dock support.
tests/devices/traits/v1/test_dust_collection_mode.pySwitches parametrization to capability-based dock support (collectable vs not).
tests/devices/traits/v1/helpers.pyAdds helper to generate dock-type parametrizations by RoborockDockFeatures capability.
tests/devices/traits/v1/fixtures.pyUpdates default dock type fixture value to new enum naming.
tests/data/v1/test_v1_containers.pyUpdates expected dock type enum members to new names/mappings.
roborock/devices/traits/v1/wash_towel_mode.pyChanges trait gating to requires_dock_features based on wash capability.
roborock/devices/traits/v1/smart_wash_params.pyChanges trait gating to requires_dock_features based on wash capability.
roborock/devices/traits/v1/dust_collection_mode.pyChanges trait gating to requires_dock_features based on collect capability.
roborock/devices/traits/v1/init.pyUpdates feature discovery to compute RoborockDockFeatures and use it for trait support checks; adjusts dock default.
roborock/device_features.pyAdds RoborockDockFeatures and dock capability sets, replacing older dock-type helper functions/constant.
roborock/data/v1/v1_containers.pyAdds has_am computed property derived from dss.
roborock/data/v1/v1_code_mappings.pyRenames dock type enum members to a new naming scheme.
Comments suppressed due to low confidence (1)

roborock/device_features.py:849

  • This change removes previously public helpers (is_valid_dock, is_wash_n_fill_dock) and the WASH_N_FILL_DOCK_TYPES constant. Even if the new RoborockDockFeatures model is preferred internally, keeping thin wrapper aliases helps avoid unnecessary breaking changes for downstream consumers.
 @property
def is_special_support_wash_temp(self) -> bool:
return self.dock_type in _SPECIAL_WASH_TEMP_DOCK_TYPES

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadroborock/data/v1/v1_containers.py
Comment threadroborock/data/v1/v1_containers.py
Comment threadroborock/data/v1/v1_code_mappings.py
@codecov

codecovBot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.72193% with 8 lines in your changes missing coverage. Please review.

Files with missing linesPatch %Lines
roborock/device_features.py96.42%3 Missing ⚠️
roborock/data/v1/v1_containers.py80.00%1 Missing and 1 partial ⚠️
roborock/devices/traits/v1/__init__.py86.66%0 Missing and 2 partials ⚠️
tests/devices/traits/v1/fixtures.py0.00%1 Missing ⚠️
Files with missing linesCoverage Δ
roborock/data/v1/v1_code_mappings.py100.00% <100.00%> (ø)
roborock/devices/traits/v1/dust_collection_mode.py100.00% <100.00%> (ø)
roborock/devices/traits/v1/smart_wash_params.py100.00% <100.00%> (ø)
roborock/devices/traits/v1/wash_towel_mode.py83.87% <100.00%> (+1.11%)⬆️
roborock/testing/v1_simulator.py80.74% <ø> (ø)
tests/data/v1/test_v1_containers.py100.00% <100.00%> (ø)
tests/devices/traits/v1/helpers.py100.00% <100.00%> (ø)
...sts/devices/traits/v1/test_dust_collection_mode.py100.00% <100.00%> (ø)
tests/devices/traits/v1/test_smart_wash_params.py100.00% <100.00%> (ø)
tests/devices/traits/v1/test_wash_towel_mode.py100.00% <100.00%> (ø)
... and 6 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@allenporterallenporter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. i didn't totally get what was going on here before so happy to see this.


class RoborockDockTypeCode(RoborockEnum):
unknown = -9999
no_dock = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we'll want to mark this as breaking given its used by callers (e.g. home assistant)

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will tag with breaking on merge! I believe I can just do a comment in the commit description and semantic will tag it.

i.e.
BREAKING CHANGE: RoborockDockTypeCode enum members were renamed, which may require downstream callers to update references

Comment threadroborock/devices/traits/v1/__init__.py Outdated
@Lash-L
Lash-L requested a review from allenporterJuly 8, 2026 02:46
@Lash-L
Lash-L merged commit 73ba2bf into mainJul 8, 2026
8 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Lash-L@allenporter