Skip to content

Commit 7684bff

Browse files
committed
feat(ios): apply cadence_gain and cadence_offset in Apple Watch cadence path
The cadence_gain and cadence_offset settings are already exposed in the UI and applied by other device drivers (Proform, Domyos, etc.), but were not applied when Cadence is sourced from Apple Watch step cadence. This made the settings dead-weight for users on the Fake Treadmill / Apple Watch path. Wires up the existing settings so users can scale or offset the broadcast Cadence (useful when receiving apps interpret BLE FTMS cadence with different scaling than QZ broadcasts). Defaults are no-ops (gain=1, offset=0). Speed calculation still uses raw cadence so the Wheel Ratio behaves identically.
1 parent f964d67 commit 7684bff

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/devices/treadmill.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,13 @@ bool treadmill::cadenceFromAppleWatch() {
622622
QZSettings::default_fakedevice_treadmill).toBool();
623623
if (appleWatchCadence > 0) {
624624
evaluateStepCount();
625-
Cadence = appleWatchCadence;
625+
const double cadenceGain =
626+
settings.value(QZSettings::cadence_gain,
627+
QZSettings::default_cadence_gain).toDouble();
628+
const double cadenceOffset =
629+
settings.value(QZSettings::cadence_offset,
630+
QZSettings::default_cadence_offset).toDouble();
631+
Cadence = (appleWatchCadence * cadenceGain) + cadenceOffset;
626632
if (appleWatchTreadmillSpeed) {
627633
const double ratio =
628634
settings.value(QZSettings::cadence_sensor_speed_ratio,

0 commit comments

Comments
 (0)