Skip to content

firmware: Swap Buttons — reverse on-device open/close roles - #40

Merged
daniel-frenkel merged 3 commits into
mainfrom
feature/swap-buttons
Jul 30, 2026
Merged

daniel-frenkel merged 3 commits into
mainfrom
feature/swap-buttons

Conversation

@daniel-frenkel

@daniel-frenkel daniel-frenkel commented Jul 30, 2026 •

Copy link
Copy Markdown
Member

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.

Normal (default) Swapped ↔
Button 1 close · hold-close · 7-tap homing open · hold-open
Button 2 open · hold-open close · hold-close · 7-tap homing
Stop-while-moving · both-held set-home both both

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_swap to 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 a b2_tap_commit. Homing, stop, and set-home are direction-agnostic and unchanged.

Notes

  • Product-layer only — no core change, no OTA-asset change.
  • Backward-compatible — default Normal reproduces today's behavior exactly.
  • Like Motor Direction, the select holds no state of its own — reads/writes the persisted global_btn_swap.
  • Only remaps the on-device buttons; web UI / Home Assistant / schedule are unaffected. (A left-side install usually wants Motor Direction = Reversed too.)
  • Also includes an unrelated hardware commit (Add Prusa 3MF, rename Bambu 3MF) that landed on this branch.

🤖 Generated with Claude Code

daniel-frenkel and others added 3 commits July 30, 2026 08:31
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>
@daniel-frenkel daniel-frenkel changed the title Feature/swap buttons firmware: Swap Buttons — reverse on-device open/close roles Jul 30, 2026
@daniel-frenkel
daniel-frenkel merged commit 8b90c53 into main Jul 30, 2026
2 checks passed
@daniel-frenkel
daniel-frenkel deleted the feature/swap-buttons branch July 30, 2026 16:30
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.

1 participant