misc: refactored ui.display.video as ui.web

This commit is contained in:
Simone Margaritelli
2019-11-12 21:19:31 +01:00
parent 91b409053b
commit 81a89d43e0
5 changed files with 21 additions and 23 deletions

View File

@ -25,9 +25,6 @@ class Display(View):
)
self._render_thread_instance.start()
def set_ready(self):
self._webui.start()
def is_inky(self):
return self._implementation.name == 'inky'
@ -91,8 +88,8 @@ class Display(View):
def _on_view_rendered(self, img):
try:
if self._config['ui']['display']['video']['on_frame'] != '':
os.system(self._config['ui']['display']['video']['on_frame'])
if self._config['ui']['web']['on_frame'] != '':
os.system(self._config['ui']['web']['on_frame'])
except Exception as e:
logging.error("%s" % e)

View File

@ -16,13 +16,13 @@ from pwnagotchi.ui.web.handler import Handler
class Server:
def __init__(self, agent, config):
self._enabled = config['video']['enabled']
self._port = config['video']['port']
self._address = config['video']['address']
self._enabled = config['web']['enabled']
self._port = config['web']['port']
self._address = config['web']['address']
self._origin = None
self._agent = agent
if 'origin' in config['video']:
self._origin = config['video']['origin']
if 'origin' in config['web']:
self._origin = config['web']['origin']
if self._enabled:
_thread.start_new_thread(self._http_serve, ())