mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
new: the auto-update plugin now triggers an on_updating event that other plugins can intercept (see led plugin)
This commit is contained in:
@ -87,6 +87,7 @@ main:
|
|||||||
# o=on space=off, comment the ones you don't want
|
# o=on space=off, comment the ones you don't want
|
||||||
patterns:
|
patterns:
|
||||||
loaded: 'oo oo oo oo oo oo oo'
|
loaded: 'oo oo oo oo oo oo oo'
|
||||||
|
updating: 'oo oo oo oo oo oo oo'
|
||||||
# internet_available: 'oo oo oo oo oo oo oo'
|
# internet_available: 'oo oo oo oo oo oo oo'
|
||||||
ready: 'oo oo oo oo oo oo oo'
|
ready: 'oo oo oo oo oo oo oo'
|
||||||
ai_ready: 'oo oo oo oo oo oo oo'
|
ai_ready: 'oo oo oo oo oo oo oo'
|
||||||
|
@ -198,6 +198,7 @@ class AutoUpdate(plugins.Plugin):
|
|||||||
if num_updates > 0:
|
if num_updates > 0:
|
||||||
if self.options['install']:
|
if self.options['install']:
|
||||||
for update in to_install:
|
for update in to_install:
|
||||||
|
plugins.on('updating')
|
||||||
if install(display, update):
|
if install(display, update):
|
||||||
num_installed += 1
|
num_installed += 1
|
||||||
else:
|
else:
|
||||||
|
@ -25,7 +25,7 @@ class Example(plugins.Plugin):
|
|||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
logging.warning("WARNING: this plugin should be disabled! options = " % self.options)
|
logging.warning("WARNING: this plugin should be disabled! options = " % self.options)
|
||||||
|
|
||||||
# called in manual mode when there's internet connectivity
|
# called hen there's internet connectivity
|
||||||
def on_internet_available(self, agent):
|
def on_internet_available(self, agent):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -69,7 +69,11 @@ class Led(plugins.Plugin):
|
|||||||
finally:
|
finally:
|
||||||
self._is_busy = False
|
self._is_busy = False
|
||||||
|
|
||||||
# called in manual mode when there's internet connectivity
|
# called when the unit is updating its software
|
||||||
|
def on_updating(self):
|
||||||
|
self._on_event('updating')
|
||||||
|
|
||||||
|
# called when there's internet connectivity
|
||||||
def on_internet_available(self, agent):
|
def on_internet_available(self, agent):
|
||||||
self._on_event('internet_available')
|
self._on_event('internet_available')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user