From 66e8fe3ba76cf72a71a8fece1532fb9597813e0a Mon Sep 17 00:00:00 2001 From: Arseniy-Movshev Date: Mon, 29 May 2023 15:42:25 +0100 Subject: Make sure step count doesn't duplicate this works in general, but won't work on devices such as catfish or medaka, which are able to count steps when the step counter isn't active. Those will need custom code in the future. --- daemon/sensorPlugins/stepCounter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'daemon/sensorPlugins') diff --git a/daemon/sensorPlugins/stepCounter.cpp b/daemon/sensorPlugins/stepCounter.cpp index fe8370c..35618f2 100644 --- a/daemon/sensorPlugins/stepCounter.cpp +++ b/daemon/sensorPlugins/stepCounter.cpp @@ -41,7 +41,7 @@ StepCounterPlugin::StepCounterPlugin(QObject *parent, int initInterval) : if (stepcounterSensor->reading()->steps() == 0) { stepsOffset = -(lastLineData[1].toInt()); } else { - + stepsOffset = - stepcounterSensor->reading()->steps() + (lastLineData[1].toInt()); } } else { //if it's a new day, we 'reset' the counter. this is crude - we should really check for a boot here, since certain machines have capability of counting steps when powered down. -- cgit v1.2.3-70-g09d2