Add quietdrift (quiet mode) support for roller shades#456
Add quietdrift (quiet mode) support for roller shades#456bdraco merged 3 commits intosblibs:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 13 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds “quietdrift” (quiet mode) support to Switchbot Roller Shade command generation so open(), close(), and set_position() can encode the requested motor mode into the BLE payload.
Changes:
- Update Roller Shade
open()/close()to build the second command dynamically using the providedmode. - Adjust Roller Shade command constants to use a shared base prefix for the second command.
- Expand unit tests to cover default vs quiet mode for
open(),close(), andset_position().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
switchbot/devices/roller_shade.py |
Builds open/close command payloads using the provided mode rather than hardcoding performance mode. |
tests/test_roller_shade.py |
Adds/updates tests asserting the correct command bytes are sent for performance vs quiet mode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
The open(), close(), and set_position() methods now accept a mode parameter (0 = performance, 1 = quiet) that controls motor speed. Previously open() and close() ignored the mode parameter and always sent hardcoded performance-mode commands.
|
@bdraco Please let me know if any changes are needed in order to get this merged in. Most of this functionality is modeled after |
The open(), close(), and set_position() methods now accept a mode parameter (0 = performance, 1 = quiet) that controls motor speed. Previously open() and close() ignored the mode parameter and always sent hardcoded performance-mode commands.