Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-09-14 22:59:55 +02:00
committed by Jeroen Oudshoorn
parent 52be2aa90f
commit bb4d962957
8 changed files with 61 additions and 32 deletions

View File

@ -423,7 +423,6 @@ class BTTether(plugins.Plugin):
__license__ = 'GPL3'
__description__ = 'This makes the display reachable over bluetooth'
def __init__(self):
self.ready = False
self.options = dict()
@ -432,7 +431,6 @@ class BTTether(plugins.Plugin):
self.running = True
self.status = '-'
def on_loaded(self):
# new config
if 'devices' in self.options:
@ -574,18 +572,15 @@ class BTTether(plugins.Plugin):
if any_device_connected:
self.status = 'C'
def on_unload(self, ui):
self.running = False
with ui._lock:
ui.remove_element('bluetooth')
def on_ui_setup(self, ui):
with ui._lock:
ui.add_element('bluetooth', LabeledValue(color=BLACK, label='BT', value='-', position=(ui.width() / 2 - 15, 0),
label_font=fonts.Bold, text_font=fonts.Medium))
def on_ui_update(self, ui):
ui.set('bluetooth', self.status)