fix: wrong string printed at the end of ringing

This commit is contained in:
thiswillbeyourgithub 2022-05-06 18:31:37 +02:00
parent 4201f264a9
commit db9350dffc
1 changed files with 6 additions and 5 deletions

View File

@ -148,12 +148,13 @@ class SleepTkApp():
def _try_stop_alarm(self):
"""If button or swipe more than _STOP_LIMIT, then stop ringing"""
self._stop_trial += 1
if self._stop_trial >= _STOP_LIMIT:
if self._stop_trial + 1 >= _STOP_LIMIT:
wasp.system.cancel_alarm(self._WU_t, self._activate_ticks_to_ring)
self._disable_tracking()
self.__init__()
self.foreground()
else:
self._stop_trial += 1
draw = wasp.watch.drawable
draw.set_color(_FONT_COLOR)
draw.string("{} to stop".format(_STOP_LIMIT - self._stop_trial), 0, 70)