diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-02-25 07:45:53 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-02-25 07:45:53 (GMT) |
| commit | affa101169ea242d7597078bc131403eb3624f5a (patch) | |
| tree | be6d39aba3b796b1b9ac871b349b2c703bde95e6 | |
| parent | 474851219a8ee3d373b61e33d6a3fcce48fca6cb (diff) | |
steplogger: Ensure today's data is updated when we provide it
Currently steps from the last six minutes do not appear in the data. We
can fix this by updating the data before creating the iterator.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
| -rw-r--r-- | wasp/steplogger.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wasp/steplogger.py b/wasp/steplogger.py index 77eb5fd..ca5a968 100644 --- a/wasp/steplogger.py +++ b/wasp/steplogger.py @@ -153,6 +153,11 @@ class StepLogger: now = time.localtime(self._t) if now[:3] == t[:3]: latest = self._data + + # Work out where we are in the dump period and update + # with the latest counts + i = self._t % DUMP_PERIOD // TICK_PERIOD + latest[i] = wasp.watch.accel.steps - self._steps else: latest = None |
