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>
This commit is contained in:
Daniel Thompson 2020-12-29 20:09:47 +00:00
parent 2641616ff6
commit f19188b962

View file

@ -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."""