refactor
This commit is contained in:
parent
3c241b2cbf
commit
cc19fb5b6e
@ -3,8 +3,6 @@ import argparse
|
||||
import time
|
||||
import logging
|
||||
|
||||
import yaml
|
||||
|
||||
import pwnagotchi
|
||||
import pwnagotchi.utils as utils
|
||||
import pwnagotchi.version as version
|
||||
@ -73,16 +71,7 @@ elif args.do_manual:
|
||||
else:
|
||||
logging.info("entering auto mode ...")
|
||||
|
||||
agent.start_ai()
|
||||
agent.setup_events()
|
||||
agent.set_starting()
|
||||
agent.start_monitor_mode()
|
||||
agent.start_event_polling()
|
||||
|
||||
# print initial stats
|
||||
agent.next_epoch()
|
||||
|
||||
agent.set_ready()
|
||||
agent.start()
|
||||
|
||||
while True:
|
||||
try:
|
||||
|
@ -138,6 +138,16 @@ class Agent(Client, AsyncAdvertiser, AsyncTrainer):
|
||||
|
||||
self.start_advertising()
|
||||
|
||||
def start(self):
|
||||
self.start_ai()
|
||||
self.setup_events()
|
||||
self.set_starting()
|
||||
self.start_monitor_mode()
|
||||
self.start_event_polling()
|
||||
# print initial stats
|
||||
self.next_epoch()
|
||||
self.set_ready()
|
||||
|
||||
def wait_for(self, t, sleeping=True):
|
||||
plugins.on('sleep' if sleeping else 'wait', self, t)
|
||||
self._view.wait(t, sleeping)
|
||||
|
Loading…
x
Reference in New Issue
Block a user