diff --git a/wasp/manager.py b/wasp/manager.py index d55df63..2c9ab8c 100644 --- a/wasp/manager.py +++ b/wasp/manager.py @@ -7,6 +7,7 @@ class Manager(object): self.watch = watch self.switch(clock.ClockApp()) self.sleep_at = watch.rtc.uptime + 90 + self.charging = True def switch(self, app): self.app = app @@ -23,13 +24,15 @@ class Manager(object): if self.watch.rtc.uptime > self.sleep_at: self.watch.backlight.set(0) self.watch.display.poweroff() + self.charging = self.watch.battery.charging() self.sleep_at = None gc.collect() else: self.watch.rtc.update() - if self.watch.button.value(): + charging = self.watch.battery.charging() + if self.watch.button.value() or self.charging != charging: self.watch.display.poweron() self.app.update(self.watch) self.watch.backlight.set(2)