summaryrefslogtreecommitdiff
path: root/wasp/apps
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-11-26 21:23:38 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-11-26 21:23:38 (GMT)
commit4c0120aa1ea93a280824e96e9221b8dbee82121f (patch)
tree922007b9b4be49670158ce250b1d358feec952ec /wasp/apps
parentb1326e16092babc7d353f2fdc724b6decc63c129 (diff)
apps: settings: Avoid circular dependancies during app init
wasp.system cannot be safely be used from app __init__ methods. Move the initial value settings to the foreground method instead. Fixes: b1326e16092b ("apps: settings: Fix initial slider value") Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/apps')
-rw-r--r--wasp/apps/settings.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/wasp/apps/settings.py b/wasp/apps/settings.py
index 2ed3217..a50cd9c 100644
--- a/wasp/apps/settings.py
+++ b/wasp/apps/settings.py
@@ -19,9 +19,9 @@ class SettingsApp():
def __init__(self):
self._slider = wasp.widgets.Slider(3, 10, 90)
- self._slider.value = wasp.system.brightness - 1
def foreground(self):
+ self._slider.value = wasp.system.brightness - 1
self._draw()
wasp.system.request_event(wasp.EventMask.TOUCH)