diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-04-12 07:59:37 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-04-12 07:59:37 (GMT) |
| commit | 64afea0d0700edde10723bd243c2a4193d41063d (patch) | |
| tree | 314e40f01af4b87c18f79085ce4a792135c02e26 /wasp/wasp.py | |
| parent | b649cd1b2424fd8492cfecbc6034649ad4c2f376 (diff) | |
WIP: Introduce the quick_ring
Diffstat (limited to 'wasp/wasp.py')
| -rw-r--r-- | wasp/wasp.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/wasp/wasp.py b/wasp/wasp.py index e32e914..7f88cdf 100644 --- a/wasp/wasp.py +++ b/wasp/wasp.py @@ -82,26 +82,29 @@ class Manager(): def __init__(self): self.app = None - self.applications = [] - self.blank_after = 15 - self.charging = True + self.quick_ring = [] self.launcher = LauncherApp() + self.launcher_ring = [] + + self.blank_after = 15 self._brightness = 2 self._button = PinHandler(watch.button) + self._charging = True # TODO: Eventually these should move to main.py self.register(ClockApp(), True) - self.register(FlashlightApp(), True) - self.register(SettingsApp(), True) - self.register(TestApp(), True) + self.register(StopwatchApp(), True) + self.register(FlashlightApp(), False) + self.register(SettingsApp(), False) + self.register(TestApp(), False) def register(self, app, quick_ring=True): """Register an application with the system. :param object app: The application to regsister """ - self.applications.append(app) + self.quick_ring.append(app) @property def brightness(self): @@ -151,7 +154,7 @@ class Manager(): :param int direction: The direction of the navigation """ - app_list = self.applications + app_list = self.quick_ring if direction == EventType.LEFT: if self.app in app_list: @@ -207,10 +210,10 @@ class Manager(): """ watch.backlight.set(0) if 'sleep' not in dir(self.app) or not self.app.sleep(): - self.switch(self.applications[0]) + self.switch(self.quick_ring[0]) self.app.sleep() watch.display.poweroff() - self.charging = watch.battery.charging() + self._charging = watch.battery.charging() self.sleep_at = None def wake(self): @@ -291,8 +294,8 @@ class Manager(): else: watch.rtc.update() - charging = watch.battery.charging() - if 1 == self._button.get_event() or self.charging != charging: + if 1 == self._button.get_event() or \ + self._charging != watch.battery.changing(): self.wake() def run(self, no_except=True): @@ -303,7 +306,7 @@ class Manager(): can be observed interactively via the console. """ if not self.app: - self.switch(self.applications[0]) + self.switch(self.quick_ring[0]) # Reminder: wasptool uses this string to confirm the device has # been set running again. |
