summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorArseniy-Movshev <dodoradio@outlook.com>2023-05-29 15:42:25 +0100
committerArseniy-Movshev <dodoradio@outlook.com>2023-05-29 18:06:47 +0100
commit66e8fe3ba76cf72a71a8fece1532fb9597813e0a (patch)
tree675b37b902eb8339da3b0b38d537b06b2fc60e39 /daemon
parent580f53c0fd69468f5867a2e4c8bb80b031540643 (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.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/sensorPlugins/stepCounter.cpp2
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.