widgets: clock: Improve the redraw logic

Currently if we wake the watch exactly N hours (where N is integer)
after it goes to sleep then the time will not be updated. Fix this the
obvious way.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2020-11-22 09:27:14 +00:00
parent 748e5fe65a
commit bfa715b488

View file

@ -102,7 +102,8 @@ class Clock:
if on_screen and on_screen == now:
return None
if self.enabled and (not on_screen or now[4] != on_screen[4]):
if self.enabled and (not on_screen
or now[4] != on_screen[4] or now[3] != on_screen[3]):
t1 = '{:02}:{:02}'.format(now[3], now[4])
draw = wasp.watch.drawable