diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-29 20:09:47 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-29 20:09:47 (GMT) |
| commit | f19188b96248f24f0d4e161d5c21f161b3527662 (patch) | |
| tree | 25b1dca858331cb47693ee68933db8353cbce2a4 /wasp/apps/alarm.py | |
| parent | 2641616ff6c2d131418c51036bbb57d6cc7cf997 (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/alarm.py')
| -rw-r--r-- | wasp/apps/alarm.py | 5 |
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.""" |
