Skip to content

feat: add better dock feature control#867

Open
Lash-L wants to merge 5 commits into
mainfrom
roborock_dock_features
Open

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

Conversation

@Lash-L

@Lash-L Lash-L commented Jul 7, 2026

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.

Copilot AI 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
File Description
tests/test_supported_features.py Adds coverage for RoborockDockFeatures capability flags and AM-variant behavior.
tests/devices/traits/v1/test_wash_towel_mode.py Switches parametrization to capability-based dock support; updates specific dock types used in tests.
tests/devices/traits/v1/test_smart_wash_params.py Switches parametrization to capability-based dock support.
tests/devices/traits/v1/test_dust_collection_mode.py Switches parametrization to capability-based dock support (collectable vs not).
tests/devices/traits/v1/helpers.py Adds helper to generate dock-type parametrizations by RoborockDockFeatures capability.
tests/devices/traits/v1/fixtures.py Updates default dock type fixture value to new enum naming.
tests/data/v1/test_v1_containers.py Updates expected dock type enum members to new names/mappings.
roborock/devices/traits/v1/wash_towel_mode.py Changes trait gating to requires_dock_features based on wash capability.
roborock/devices/traits/v1/smart_wash_params.py Changes trait gating to requires_dock_features based on wash capability.
roborock/devices/traits/v1/dust_collection_mode.py Changes trait gating to requires_dock_features based on collect capability.
roborock/devices/traits/v1/init.py Updates feature discovery to compute RoborockDockFeatures and use it for trait support checks; adjusts dock default.
roborock/device_features.py Adds RoborockDockFeatures and dock capability sets, replacing older dock-type helper functions/constant.
roborock/data/v1/v1_containers.py Adds has_am computed property derived from dss.
roborock/data/v1/v1_code_mappings.py Renames 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 thread roborock/data/v1/v1_containers.py
Comment thread roborock/data/v1/v1_containers.py
Comment thread roborock/data/v1/v1_code_mappings.py
@codecov

codecov Bot 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 lines Patch % Lines
roborock/device_features.py 96.42% 3 Missing ⚠️
roborock/data/v1/v1_containers.py 80.00% 1 Missing and 1 partial ⚠️
roborock/devices/traits/v1/__init__.py 86.66% 0 Missing and 2 partials ⚠️
tests/devices/traits/v1/fixtures.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
roborock/data/v1/v1_code_mappings.py 100.00% <100.00%> (ø)
roborock/devices/traits/v1/dust_collection_mode.py 100.00% <100.00%> (ø)
roborock/devices/traits/v1/smart_wash_params.py 100.00% <100.00%> (ø)
roborock/devices/traits/v1/wash_towel_mode.py 83.87% <100.00%> (+1.11%) ⬆️
roborock/testing/v1_simulator.py 80.74% <ø> (ø)
tests/data/v1/test_v1_containers.py 100.00% <100.00%> (ø)
tests/devices/traits/v1/helpers.py 100.00% <100.00%> (ø)
...sts/devices/traits/v1/test_dust_collection_mode.py 100.00% <100.00%> (ø)
tests/devices/traits/v1/test_smart_wash_params.py 100.00% <100.00%> (ø)
tests/devices/traits/v1/test_wash_towel_mode.py 100.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.

@allenporter allenporter 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
Collaborator Author

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 thread roborock/devices/traits/v1/__init__.py Outdated
@Lash-L Lash-L requested a review from allenporter July 8, 2026 02:46
Sign up for free to 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