summaryrefslogtreecommitdiff
path: root/wasp/wasp.py
diff options
context:
space:
mode:
authorCarlosgg <carlosgilglez@gmail.com>2020-10-27 17:10:56 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-11-29 20:20:03 (GMT)
commit3fb1faceab8c4067cf636e0628ab44fe77582f72 (patch)
tree83e68362ac83ed0d14769335029bd8d23ddb3461 /wasp/wasp.py
parente450ccf9f0cc7a646bfac75d6e1b67d5ee7481f0 (diff)
Notify level in settings app
Signed-off-by: Carlos Gil Gonzalez <carlosgilglez@gmail.com> [daniel@redfelineninja.org.uk: Fixed board support for simulator and sphinx (a.k.a. doc builder)] Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/wasp.py')
-rw-r--r--wasp/wasp.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/wasp/wasp.py b/wasp/wasp.py
index a44a61c..7f4d0d4 100644
--- a/wasp/wasp.py
+++ b/wasp/wasp.py
@@ -122,6 +122,12 @@ class Manager():
self._alarms = []
self._brightness = 2
+ self._notifylevel = 2
+ if 'P8' in watch.os.uname().machine:
+ self._nfylevels = [0, 225, 450]
+ else:
+ self._nfylevels = [0, 40, 80]
+ self._nfylev_ms = self._nfylevels[self._notifylevel - 1]
self._button = PinHandler(watch.button)
self._charging = True
self._scheduled = False
@@ -163,6 +169,21 @@ class Manager():
self._brightness = value
watch.backlight.set(self._brightness)
+ @property
+ def notify_level(self):
+ """Cached copy of the current notify level"""
+ return self._notifylevel
+
+ @notify_level.setter
+ def notify_level(self, value):
+ self._notifylevel = value
+ self._nfylev_ms = self._nfylevels[self._notifylevel - 1]
+
+ @property
+ def notify_duration(self):
+ """Cached copy of the current vibrator pulse duration in milliseconds"""
+ return self._nfylev_ms
+
def switch(self, app):
"""Switch to the requested application.
"""