summaryrefslogtreecommitdiff
path: root/wasp/apps
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-29 20:09:47 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-29 20:09:47 (GMT)
commitf19188b96248f24f0d4e161d5c21f161b3527662 (patch)
tree25b1dca858331cb47693ee68933db8353cbce2a4 /wasp/apps
parent2641616ff6c2d131418c51036bbb57d6cc7cf997 (diff)
apps: alarm: avoid setting a "silly" alarm during app init
The alarm is off by default so there's no reason to set an alarm that is disabled. Let's stop doing that. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/apps')
-rw-r--r--wasp/apps/alarm.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/wasp/apps/alarm.py b/wasp/apps/alarm.py
index dfeea6a..9d647da 100644
--- a/wasp/apps/alarm.py
+++ b/wasp/apps/alarm.py
@@ -55,14 +55,13 @@ class AlarmApp():
self.hours = 0
self.minutes = 0
- self._set_current_alarm()
-
def foreground(self):
"""Activate the application."""
self._draw()
wasp.system.request_event(wasp.EventMask.TOUCH)
wasp.system.request_tick(1000)
- wasp.system.cancel_alarm(self.current_alarm, self._alert)
+ if self.active.state:
+ wasp.system.cancel_alarm(self.current_alarm, self._alert)
def background(self):
"""De-activate the application."""