fix: use YXCleanType for Q10Status.clean_mode instead of YXDeviceWorkMode#810
Conversation
…Mode DPS 137 (CLEAN_MODE) reports clean type values (1=vac+mop, 2=vacuum, 3=mop) which map to YXCleanType, not YXDeviceWorkMode.
There was a problem hiding this comment.
Pull request overview
This PR corrects the Q10 (B01) status model so DPS 137 (CLEAN_MODE) is represented as YXCleanType (vac+mop / vacuum / mop) rather than YXDeviceWorkMode, aligning the decoded status type with the actual device-reported values.
Changes:
- Switch
Q10Status.clean_modetype fromYXDeviceWorkModetoYXCleanType. - Update imports accordingly in the Q10 container module.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| filter_life: int | None = field(default=None, metadata={"dps": B01_Q10_DP.FILTER_LIFE}) | ||
| sensor_life: int | None = field(default=None, metadata={"dps": B01_Q10_DP.SENSOR_LIFE}) | ||
| clean_mode: YXDeviceWorkMode | None = field(default=None, metadata={"dps": B01_Q10_DP.CLEAN_MODE}) | ||
| clean_mode: YXCleanType | None = field(default=None, metadata={"dps": B01_Q10_DP.CLEAN_MODE}) |
There was a problem hiding this comment.
clean_mode changed to YXCleanType, but existing Q10 status tests don't assert that DPS 137 is converted into the new enum type. Add/extend a test (e.g., test_status_trait_refresh, whose fixture data already includes DPS 137=1) to assert q10_api.status.clean_mode == YXCleanType.VAC_AND_MOP so regressions in enum mapping are caught.
… test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DPS 137 (
CLEAN_MODE) reports clean type values (1=vac+mop, 2=vacuum, 3=mop) which correspond toYXCleanType, notYXDeviceWorkMode.Using the wrong type forced consumers to extract the raw code and re-interpret it through
YXCleanType.from_code_optional, which is unnecessary complexity.This fix corrects the field type directly in
Q10Statusso that clean_mode is already aYXCleanTypewhen read.