Repository navigation
Set rolling codes only on the main loop; default a set-favorite tilt to the favorite tilt - #37
Merged
Merged
Conversation
/setMyPosition filled in a missing tilt with the lift favorite, so a request without a tilt set the favorite tilt to the lift's. It also took the stored position as a display one, which flipped it twice on a shade with flipPosition. requestedFavoriteTilt() now gives the favorite tilt as displayed. Home Assistant never calls /setMyPosition and the web UI always sends a tilt, so only other API callers see the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sending a command reads a remote's next rolling code, queues the frame and commits the code, all on loop(). /setRollingCode, a shades restore and /updateShadeConfig wrote the same codes from the web server task, so a set could be undone by a command's commit, and a restore could save an older code to NVS that survived the reboot. All three now go through the web command queue to loop(). They don't use the radio, so they are never held back or refused while it is busy. /restore now answers after queueing the restore. A broken options string used to send an error after the success answer had already gone out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Two fixes from
docs/KNOWN_ISSUES.md.Rolling codes are only set by
loop(). Sending a command reads, queues and commits a remote's rolling code onloop(). Three web handlers wrote the same codes from the web server task:webCommandUsesRadio)./setRollingCoderesponse reports the new code, as unpair already reportspaired:false./restorenow answers after queueing. Malformed options used to send a 500 after the 200 had already gone out.Set-favorite tilt default.
The old default also flipped twice on a shade with
flipPosition. Home Assistant never calls/setMyPosition, and the web UI always sends a tilt.Evidence
Before:
/setMyPositionwithout a tilt on a tilt shade with lift favorite 60 and tilt favorite 70 → tilt favorite set to 60.After:
test_motion:test_webcmd:set_rolling_code,restore_shadesandload_shadesstay off the radio and are never held, even while it is suspended or full.pio test -e native: 222 → 226 test cases, all passing.Flash,
esp32devdbg: 1,545,717 → 1,546,405 bytes.Builds locally: esp32devdbg, esp32dev, esp32c3, esp32s3. esp32c6 is left to CI.
Hardware (not yet done):
/setMyPositionwith and withouttilton a tilt shadeMerge Danger
Door: two-way
No stored formats or API routes change.
Blast Radius: API
/setRollingCodeapplies on the nextloop()pass instead of before the response./setRollingCodeand/restoreanswer 503 when the web command queue is full./updateShadeConfigcan't answer from its upload handler, so a full queue only logs and drops the upload.loop(), which is busy reading the file for that moment. The device still reboots 1 s later.tiltout of/setMyPositionnow keep the favorite tilt instead of getting the lift favorite.🤖 Generated with Claude Code