Skip to content

feat: Auto-pause workout on sensor dropout #148

@MaximumTrainer

Description

@MaximumTrainer

Summary

Automatically pause the workout timer and ERG setpoint when the primary power or heart-rate sensor drops out for more than a configurable number of seconds, and resume automatically when the signal recovers.

Motivation

Currently a sensor dropout causes workout time to elapse with no data recorded and power targets remaining active on the trainer. Auto-pause prevents wasted training time and avoids incorrect workout metrics caused by silent data gaps.

Acceptance Criteria

  • A configurable sensor dropout timeout (default: 5 s, range: 2–30 s) is exposed in the Trainer preferences tab
  • When power (and/or HR, configurable) is absent for longer than the timeout, the workout is automatically paused and a dismissable overlay displays ''Sensor signal lost — workout paused''
  • ERG load commands stop being sent while auto-paused
  • When the sensor signal recovers, the workout resumes automatically after a 3-second countdown displayed on the overlay
  • Auto-pause events are logged in the FIT file as pauses (identical to a manual pause)
  • The auto-pause toggle can be disabled entirely in Preferences (e.g. for heart-rate-only sessions)
  • Behaviour works identically in both ERG and slope modes
  • Unit tests cover the dropout detection logic at boundary conditions (exactly at timeout, just below timeout)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions