Skip to content

Add quietdrift (quiet mode) support for roller shades#456

Merged
bdraco merged 3 commits intosblibs:masterfrom
sjafferali:master
Apr 23, 2026
Merged

Add quietdrift (quiet mode) support for roller shades#456
bdraco merged 3 commits intosblibs:masterfrom
sjafferali:master

Conversation

@sjafferali
Copy link
Copy Markdown
Contributor

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
switchbot/devices/roller_shade.py 100.00% <100.00%> (ø)

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

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 provided mode.
  • 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(), and set_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.

Comment thread switchbot/devices/roller_shade.py Outdated
Comment thread switchbot/devices/roller_shade.py Outdated
Comment thread switchbot/devices/roller_shade.py Outdated
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.
@sjafferali
Copy link
Copy Markdown
Contributor Author

@bdraco Please let me know if any changes are needed in order to get this merged in. Most of this functionality is modeled after switchbot/devices/curtain.py and I have tested the mode/speed arguments on my roller shades.

@bdraco bdraco merged commit 40afa90 into sblibs:master Apr 23, 2026
6 checks passed
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