Repository navigation
firmware: Swap Buttons — reverse on-device open/close roles - #40
Merged
Merged
Conversation
For mirror-image installs (pull-rope on the left instead of the right) where the unit sits flipped and the two buttons feel reversed. Default OFF keeps the shipped layout (Button 1 = close, Button 2 = open); ON makes Button 1 open and Button 2 close. The handlers are now role-symmetric: each button reads btn_swap to decide whether it is the close button (deferred single-tap close + 7-tap homing gesture) or the open button (immediate open). So the 7-tap homing gesture always follows the CLOSE button — Button 2 gains its own tap counter (b2_tap_count / b2_last_tap_ms) and a b2_tap_commit script for when it closes. Stop-while-moving, the two-button set-home combo, and homing itself are direction-agnostic and unchanged. Product-layer only; no core change, no OTA-asset change; backward-compatible (default OFF = today's behaviour). Validated: `esphome config` valid and main.cpp compiles clean (build reaches the known local esptool .bin break). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rename platter-all-v1.2.1.3mf to platter-all-v1.2.1-Bambu.3mf to explicitly identify the Bambu variant, and add a new binary platter-all-v1.2.1-Prusa.3mf for the Prusa-specific 3MF. Files placed under hardware/plastics/v1.2.1.
Per the sibling install-orientation setting, convert the toggle from a template
switch to a template select with named states ("Normal" / "Swapped ↔"), sitting
right under Motor Direction in Setup. Like Motor Direction it holds no state of
its own: it reads/writes a persisted global (global_btn_swap) and never fights
the restored value. Behaviour is identical to the switch version.
Verified: esphome config valid, compiles clean, OTA-flashed to VAL3000 @ .58 --
device boots with 'Swap Buttons' select showing "Normal".
Co-Authored-By: Claude Opus 4.8 <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.
Adds a Swap Buttons control so the two on-device buttons' open/close roles can be reversed — for mirror-image installs (pull-rope on the left instead of the right) where the flipped unit makes the buttons feel backwards. Requested by a customer with a second unit on a left-side window.
Tested on hardware (VAL3000 @ 192.168.86.58) — all gestures confirmed working in both states. ✅
UX
A template select in Setup, right under Motor Direction (same install-orientation pattern): Normal / Swapped ↔. Default Normal = the shipped layout, so existing units are unchanged.
The 7-tap homing gesture follows the close button, so it's always on whichever button closes. The handlers are now role-symmetric: each button reads
global_btn_swapto decide if it's the close button (deferred single-tap close + tap-count/homing) or the open button (immediate open). Button 2 gained its own tap counter (b2_tap_count/b2_last_tap_ms) and ab2_tap_commit. Homing, stop, and set-home are direction-agnostic and unchanged.Notes
global_btn_swap.Add Prusa 3MF, rename Bambu 3MF) that landed on this branch.🤖 Generated with Claude Code