Skip to content

fix: add missing DPS fields to Q10Status and fix CLEAN_PROGRESS mapping#791

Merged
allenporter merged 2 commits intoPython-roborock:mainfrom
lboue:fix/q10-status-dps-mapping
Mar 21, 2026
Merged

fix: add missing DPS fields to Q10Status and fix CLEAN_PROGRESS mapping#791
allenporter merged 2 commits intoPython-roborock:mainfrom
lboue:fix/q10-status-dps-mapping

Conversation

@lboue
Copy link
Contributor

@lboue lboue commented Mar 21, 2026

Fix: Q10 Status DPS Mapping (fix/q10-status-dps-mapping)

Problem
The Q10Status dataclass was missing several DPS-mapped fields and had an incorrect enum reference (B01_Q10_DP.CLEANING_PROGRESS instead of B01_Q10_DP.CLEAN_PROGRESS), causing device data to be silently dropped when updating status from raw device responses.

Changes

  • b01_q10_containers.py: Added 7 missing fields to Q10Status (total_clean_area, total_clean_count, total_clean_time, main_brush_life, side_brush_life, filter_life, sensor_life)
  • fixed the cleaning_progress field to use the correct B01_Q10_DP.CLEAN_PROGRESS enum value.
  • test_status.py: Extended test_status_trait_refresh to assert the new fields are None before refresh and hold the expected values after the device response is processed.

Tests
All 4 tests pass: test_status_trait_streaming, test_status_trait_refresh, test_status_trait_update_listener, test_status_trait_update_listener_ignores_value.

@lboue lboue marked this pull request as ready for review March 21, 2026 15:17
Copilot AI review requested due to automatic review settings March 21, 2026 15:17
Copy link
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 fixes B01 Q10 status DPS mappings so additional device status datapoints are no longer silently dropped, and corrects the cleaning progress datapoint mapping.

Changes:

  • Add missing DPS-mapped fields to Q10Status (totals + consumable life values).
  • Fix cleaning_progress to map to B01_Q10_DP.CLEAN_PROGRESS.
  • Extend the Q10 status trait refresh test to assert the new fields are populated from a device response.

Reviewed changes

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

File Description
roborock/data/b01_q10/b01_q10_containers.py Extends Q10Status DPS field coverage and corrects the cleaning progress DPS mapping.
tests/devices/traits/b01/q10/test_status.py Adds assertions verifying the new status fields are None before refresh and correctly set after processing the response.

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

Copy link
Contributor

@allenporter allenporter left a comment

Choose a reason for hiding this comment

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

Seems good. I think we may want to have things like brush life in a different trait (e.g. so we can reset consumables) but this is obviously the simplest API for now.

@allenporter allenporter merged commit 526da01 into Python-roborock:main Mar 21, 2026
7 checks passed
@lboue lboue deleted the fix/q10-status-dps-mapping branch March 21, 2026 19:18
@lboue lboue restored the fix/q10-status-dps-mapping branch March 21, 2026 19:20
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