Repository navigation
fix(roller-shade): send Roller Shade commands instead of Curtain commands - #367
Merged
Merged
Conversation
…ands WoRollerShade inherited WoCurtain's commands, so setPosition sent the Curtain packet 570f450105ff<pos>, which the Roller Shade rejects with 0x0D. Use the Roller Shade command set from pySwitchbot's SwitchbotRollerShade (ROLLERSHADE_COMMAND 4701, control source 00): - setPosition/open/close: 570f470101 00 01 <position>; if that fails, the position-with-mode command 570f470105 00 <mode> <position> over BLE (mode 0 performance, 1 quiet) - pause: 570f470100 00 01 - OpenAPI setPosition takes the bare position (0 open, 100 closed) Status parsing is unchanged. Fixes #365 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LzktUspaxcZ9Dh5WVEtf5W
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
WoRollerShadewas an empty subclass ofWoCurtain, sosetPosition()sent the Curtain packet57 0F 45 01 05 FF <pos>, which the Roller Shade rejects with0x0D. It now uses the Roller Shade command set from pySwitchbot'sSwitchbotRollerShade(ROLLERSHADE_COMMAND = "4701", control source00):setPosition/open/close:57 0F 47 01 01 00 01 <position>(the packet the reporter verified on a real shade). If that is rejected,57 0F 47 01 05 00 <mode> <position>is tried over BLE.pause:57 0F 47 01 00 00 01.setPositionwith the bare position, as in the Roller Shade API page (previously the Curtain-style0,ff,<pos>).Fixes #365
Deliberate deviations
open/close/setPositionis now the pySwitchbotmode(0 performance, 1 quiet) instead of the Curtainspeed(1-255), and other values throw aRangeError. The Curtain speed never worked on a Roller Shade, and homebridge-switchbot callssetPosition(position)only, so no migration is needed there.Checks
npm run build,npm test(531 tests) andnpm run lintpass locally. New tests intest/devices/roller-shade.test.tspin the packets.Generated by Claude Code