Skip to content

feat: implement RoborockDockState synthesis and RoborockChargeStatus enum#821

Open
allenporter wants to merge 2 commits intoPython-roborock:mainfrom
allenporter:charging-dock-state
Open

feat: implement RoborockDockState synthesis and RoborockChargeStatus enum#821
allenporter wants to merge 2 commits intoPython-roborock:mainfrom
allenporter:charging-dock-state

Conversation

@allenporter
Copy link
Copy Markdown
Contributor

The goal of this PR is to improve device status reporting. Today a device is considered "charging" even though it may not actually be charging yet due to waiting for some off peak time. This adds support for additional detail from charge_status to make it easier to interpret. This also adds a higher level enum based on behavior observed in the app of explaining the current dock state.

Adds a lot of documentation about what these new combined states mean.

home-assistant/core#169151

Copilot AI review requested due to automatic review settings April 26, 2026 21:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 improves Roborock V1 status reporting by introducing a richer charge_status enum and synthesizing a higher-level dock_state that better matches the Roborock app’s UI behavior (including off-peak charging waiting).

Changes:

  • Add RoborockChargeStatus enum and type charge_status fields accordingly.
  • Add synthesized dock_state property (based on state, charge_status, battery) and RoborockDockState enum for consumers.
  • Update/extend tests and snapshots to reflect the new fields and behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
roborock/data/v1/v1_code_mappings.py Adds RoborockChargeStatus and RoborockDockState enums.
roborock/data/v1/v1_containers.py Updates charge_status typing and introduces synthesized dock_state property.
tests/data/v1/test_v1_containers.py Updates expectations for charge_status and adds dock-state parametrized tests.
tests/devices/__snapshots__/test_v1_device.ambr Updates snapshot output to include synthesized dock_state.

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

Comment thread roborock/data/v1/v1_containers.py Outdated
Comment thread tests/data/v1/test_v1_containers.py
@allenporter allenporter marked this pull request as draft April 26, 2026 22:10
@allenporter allenporter marked this pull request as ready for review April 26, 2026 22:31
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