diff options
author | Arseniy-Movshev <dodoradio@outlook.com> | 2023-05-29 15:42:25 +0100 |
---|---|---|
committer | Arseniy-Movshev <dodoradio@outlook.com> | 2023-05-29 18:06:47 +0100 |
commit | 66e8fe3ba76cf72a71a8fece1532fb9597813e0a (patch) | |
tree | 675b37b902eb8339da3b0b38d537b06b2fc60e39 | |
parent | 580f53c0fd69468f5867a2e4c8bb80b031540643 (diff) |
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.
-rw-r--r-- | daemon/sensorPlugins/stepCounter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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. |