Skip to content

fix(ble): space speed commands and step from the target during a ramp (ROADMAP 1.8) - #37

Draft
SeanathanVT wants to merge 1 commit into
developmentfrom
bugfix/speed-commands-ramp
Draft

SeanathanVT wants to merge 1 commit into
developmentfrom
bugfix/speed-commands-ramp

Conversation

@SeanathanVT

Copy link
Copy Markdown
Owner

Summary

Fixes three of the four problems in ROADMAP 1.8 and adds logging to look into the fourth (app commands ignored after a physical remote press).

  • Speed changes are sent at least 1.0 s apart (_SPEED_COMMAND_SPACING_SECONDS); a newer press replaces one still waiting, so rapid presses collapse into the latest.
  • +/- step from the status packet's app_speed (the target set by the app, km/h × 10 on a C2) while the belt ramps toward it, and from the reported speed otherwise. That covers changes made with the remote, which leave app_speed stale.
  • Resume's quick-restart check no longer accepts a falling speed, so a belt coasting to a stop isn't taken for a running one (this caused the auto-pause in the C2 log).
  • Changes to status byte 16 (controller_button) are logged at INFO.

Test plan

  • pytest on Python 3.10, 3.12, 3.13 (579 passed each); ruff check . clean
  • C2: press + twice quickly, the speed rises two steps
  • C2: Max from about 2 km/h, then - mid-ramp, lands one step below Max
  • C2: Pause, press the remote, Resume: no auto-pause; log shows the controller_button change

🤖 Generated with Claude Code

… (ROADMAP 1.8)

- Speed changes are sent at least 1.0 s apart; a newer press replaces one still waiting
- +/- step from the status packet's app_speed while the belt ramps toward it
- Resume's quick-restart check ignores a speed that is falling
- Log status byte 16 (controller_button) changes to investigate the physical remote

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SeanathanVT SeanathanVT self-assigned this Nov 11, 2026
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