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>
This commit is contained in:
parent
474851219a
commit
affa101169
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue