fix: wrong string printed at the end of ringing
This commit is contained in:
parent
4201f264a9
commit
db9350dffc
|
@ -148,12 +148,13 @@ class SleepTkApp():
|
||||||
|
|
||||||
def _try_stop_alarm(self):
|
def _try_stop_alarm(self):
|
||||||
"""If button or swipe more than _STOP_LIMIT, then stop ringing"""
|
"""If button or swipe more than _STOP_LIMIT, then stop ringing"""
|
||||||
self._stop_trial += 1
|
if self._stop_trial + 1 >= _STOP_LIMIT:
|
||||||
if self._stop_trial >= _STOP_LIMIT:
|
|
||||||
wasp.system.cancel_alarm(self._WU_t, self._activate_ticks_to_ring)
|
wasp.system.cancel_alarm(self._WU_t, self._activate_ticks_to_ring)
|
||||||
self._disable_tracking()
|
self._disable_tracking()
|
||||||
self.__init__()
|
self.__init__()
|
||||||
self.foreground()
|
self.foreground()
|
||||||
|
else:
|
||||||
|
self._stop_trial += 1
|
||||||
draw = wasp.watch.drawable
|
draw = wasp.watch.drawable
|
||||||
draw.set_color(_FONT_COLOR)
|
draw.set_color(_FONT_COLOR)
|
||||||
draw.string("{} to stop".format(_STOP_LIMIT - self._stop_trial), 0, 70)
|
draw.string("{} to stop".format(_STOP_LIMIT - self._stop_trial), 0, 70)
|
||||||
|
|
Loading…
Reference in a new issue