Skip to content

Commit 5bb87a2

Browse files
committed
Fix treadmill pause watts and Stryd steps
1 parent 583cf73 commit 5bb87a2

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/devices/treadmill.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ void treadmill::update_metrics(bool watt_calc, const double watts, const bool fr
165165
m_watt = 0;
166166
WattKg = 0;
167167
}
168+
} else if (paused && settings.value(QZSettings::instant_power_on_pause, QZSettings::default_instant_power_on_pause)
169+
.toBool()) {
170+
if (watt_calc) {
171+
m_watt = watts;
172+
}
173+
WattKg = m_watt.value() / settings.value(QZSettings::weight, QZSettings::default_weight).toFloat();
168174
} else if (m_watt.value() > 0) {
169175
m_watt = 0;
170176
WattKg = 0;
@@ -287,7 +293,12 @@ double treadmill::requestedSpeed() { return requestSpeed; }
287293
double treadmill::requestedInclination() { return requestInclination; }
288294
double treadmill::currentTargetSpeed() { return targetSpeed; }
289295

290-
void treadmill::cadenceSensor(uint8_t cadence) { Cadence.setValue(cadence); }
296+
void treadmill::cadenceSensor(uint8_t cadence) {
297+
if (Cadence.value() > 0 || cadence > 0) {
298+
evaluateStepCount();
299+
}
300+
Cadence.setValue(cadence);
301+
}
291302
void treadmill::powerSensor(uint16_t power) {
292303
double vwatts = 0;
293304
if(power > 0) {

0 commit comments

Comments
 (0)