From 0aa11d9a7f3c936354f9f48d9551b408ddd01c1b Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub Date: Thu, 5 May 2022 14:01:08 +0200 Subject: [PATCH] fix: disaBLE app out of sync Signed-off-by: thiswillbeyourgithub --- wasp/apps/disaBLE.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wasp/apps/disaBLE.py b/wasp/apps/disaBLE.py index 4293eed..977f0ff 100644 --- a/wasp/apps/disaBLE.py +++ b/wasp/apps/disaBLE.py @@ -36,10 +36,6 @@ class DisaBLEApp(): b'\xff\x00\xff\x00\xff\x00g' ) - - def __init__(self): - self._btn = widgets.Button(10, 120, 220, 80, 'Disable' if ble.enabled() else 'Reboot to enable') - def foreground(self): self._draw() wasp.system.request_event(wasp.EventMask.TOUCH) @@ -49,13 +45,15 @@ class DisaBLEApp(): draw.set_color(wasp.system.theme('bright')) draw.fill() draw.string('BLE status: ' + ('ON' if ble.enabled() else 'OFF'), 0, 60, width=240) + self._btn = widgets.Button(10, 120, 220, 80, 'Disable' if ble.enabled() else 'Reboot to enable') self._btn.draw() def touch(self, event): if self._btn.touch(event): if ble.enabled(): ble.disable() - self._btn = widgets.Button(10, 120, 220, 80, 'Reboot to enable') self._draw() else: wasp.machine.reset() + else: + self._draw()