mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-10 10:46:29 +00:00
wrap panel into function
This commit is contained in:
parent
808df68e57
commit
f5e196a663
@ -100,8 +100,12 @@ class RestAPI(object):
|
|||||||
def register_panel(self):
|
def register_panel(self):
|
||||||
"""Register panel for homeassistant."""
|
"""Register panel for homeassistant."""
|
||||||
panel = Path(__file__).parents[1].joinpath('panel/hassio-main.html')
|
panel = Path(__file__).parents[1].joinpath('panel/hassio-main.html')
|
||||||
|
|
||||||
|
def get_panel():
|
||||||
|
"""Return file response with panel."""
|
||||||
|
return web.FileResponse(panel)
|
||||||
|
|
||||||
self.webapp.router.add_get('/panel', web.FileResponse(panel))
|
self.webapp.router.add_get('/panel', get_panel)
|
||||||
|
|
||||||
async def start(self):
|
async def start(self):
|
||||||
"""Run rest api webserver."""
|
"""Run rest api webserver."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user