feat(q7): add set_button_light trait method#843
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for toggling the Q7 button/panel light setting via the Q7 properties API, along with test coverage to validate the generated prop.set payload.
Changes:
- Introduced
set_button_light(enabled: bool)onQ7PropertiesApito setRoborockB01Props.LIGHT_MODEto0/1. - Added a parametrized test that validates the outgoing DPS payload for both enabled/disabled states.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/devices/traits/b01/q7/test_init.py | Adds a new parametrized test asserting correct DPS payload when toggling button lights |
| roborock/devices/traits/b01/q7/init.py | Adds set_button_light() method wiring to LIGHT_MODE via set_prop |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| async def set_button_light(self, enabled: bool) -> None: | ||
| """Enable or disable the button/panel lights.""" | ||
| await self.set_prop(RoborockB01Props.LIGHT_MODE, int(enabled)) |
There was a problem hiding this comment.
would not change that. @Lash-L should i do (a) or (b) or nothing?
There was a problem hiding this comment.
I think it's actually fine as is. Can you change make the function plural though? As it is multiple buttons lights right?
There was a problem hiding this comment.
Or maybe match how we describe it for v1. I think we call it led something?
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cf37c6b to
277742c
Compare
Summary
Adds
set_button_light(enabled)to the Q7 (B01) trait, toggling the panel /button lights via
prop.setforRoborockB01Props.LIGHT_MODE(0/1).Part of #739.
Verification
ruffclean.