Skip to content

v0.4.8

Choose a tag to compare

@mcdax mcdax released this 10 May 07:45
· 15 commits to main since this release

Added

  • BeltState.PAUSED (= 2) on the public enum. Distinguishes "session paused, will resume" from "session ended" — the device emits FM Status STOPPED_OR_PAUSED with the PAUSE param (0x02) when the user pauses (via pause() from 0.4.7, the phone app, or the physical remote), and counters (time, distance, calories, steps) survive across the pause. Previously the library reported `STOPPED` in both cases, so callers couldn't tell them apart.

    FTMSController now tracks an internal `_paused` flag set by the FM Status handler and consulted by the Treadmill Data parser, with this derivation:

    speed > 0           -> ACTIVE   (also clears _paused)
    speed = 0 + paused  -> PAUSED
    speed = 0 + ~paused -> STOPPED
    

    _paused is cleared on STARTED_OR_RESUMED, STOPPED_OR_PAUSED+STOP, safety-key stop, every speed > 0 frame, and on disconnect.

Refs walkingpad-controller#2.