diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-26 22:12:05 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-03-26 22:12:05 (GMT) |
| commit | afb9bd16b6c811f1a211e3a159b57aa1a787073f (patch) | |
| tree | 96ada2501478518d328855cd9396669d1602f5ef /wasp/apps/flashlight.py | |
| parent | af33c7d79b46ffbaabc399e51d0040cf2bacf720 (diff) | |
wasp: Add support for brightness caching and keep-awake signalling
Diffstat (limited to 'wasp/apps/flashlight.py')
| -rw-r--r-- | wasp/apps/flashlight.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wasp/apps/flashlight.py b/wasp/apps/flashlight.py index 3336cfa..161aade 100644 --- a/wasp/apps/flashlight.py +++ b/wasp/apps/flashlight.py @@ -9,24 +9,24 @@ class FlashlightApp(object): Shows a pure white screen with the backlight set to maximum. """ - def __init__(self): - self.backlight = None - def foreground(self, effect=None): """Activate the application.""" self.on_screen = ( -1, -1, -1, -1, -1, -1 ) self.draw(effect) wasp.system.request_tick(1000) + self._brightness = wasp.system.brightness + wasp.system.brightness = 3 + def background(self): """De-activate the application (without losing state).""" - pass + wasp.system.brightness = self._brightness def sleep(self): return False def tick(self, ticks): - pass + wasp.system.keep_awake() def draw(self, effect=None): """Redraw the display from scratch.""" |
