mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Merge pull request #677 from dadav/fix/plugins_setup_ui
Fix/plugins setup ui
This commit is contained in:
@ -466,13 +466,14 @@ class BTTether(plugins.Plugin):
|
||||
logging.info("BT-TETHER: Successfully loaded ...")
|
||||
self.ready = True
|
||||
|
||||
def on_unload(self):
|
||||
self.ui.remove_element('bluetooth')
|
||||
def on_unload(self, ui):
|
||||
with ui._lock:
|
||||
ui.remove_element('bluetooth')
|
||||
|
||||
def on_ui_setup(self, ui):
|
||||
self.ui = ui
|
||||
ui.add_element('bluetooth', LabeledValue(color=BLACK, label='BT', value='-', position=(ui.width() / 2 - 15, 0),
|
||||
label_font=fonts.Bold, text_font=fonts.Medium))
|
||||
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):
|
||||
if not self.ready:
|
||||
|
@ -26,7 +26,7 @@ class Example(plugins.Plugin):
|
||||
logging.warning("WARNING: this plugin should be disabled! options = " % self.options)
|
||||
|
||||
# called before the plugin is unloaded
|
||||
def on_unload(self):
|
||||
def on_unload(self, ui):
|
||||
pass
|
||||
|
||||
# called hen there's internet connectivity
|
||||
|
Reference in New Issue
Block a user