summaryrefslogtreecommitdiff
path: root/wasp/wasp.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2021-02-25 08:00:03 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2021-02-25 08:00:03 (GMT)
commit7a5990072c230e35eb990377ddce608706cb0a0e (patch)
treed5fc0d7ee87bb013da7d95701f00d545c1c86a09 /wasp/wasp.py
parent72f5322cc31e5ec70e85d436310b8dcd15eb4f59 (diff)
apps: steps: Add a history graph
The steplogger records steps but currently there is no way to see the data recorded on the device itself. Make a first attempt at graphing the step data. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/wasp.py')
-rw-r--r--wasp/wasp.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/wasp/wasp.py b/wasp/wasp.py
index 36634e6..ad09dce 100644
--- a/wasp/wasp.py
+++ b/wasp/wasp.py
@@ -17,6 +17,7 @@
import gc
import machine
import micropython
+import steplogger
import watch
import widgets
@@ -153,7 +154,13 @@ class Manager():
(SoftwareApp, False),
(SettingsApp, False) ):
try:
- self.register(app(), qr)
+ a = app()
+
+ # Special case for watches with working step counters!
+ if isinstance(a, StepCounterApp):
+ self.steps = steplogger.StepLogger(self)
+
+ self.register(a, qr)
except:
# Let's not bring the whole device down just because there's
# an exception starting one of the apps...