wrap panel into function
@@ -101,7 +101,11 @@ class RestAPI(object):
"""Register panel for homeassistant."""
panel = Path(__file__).parents[1].joinpath('panel/hassio-main.html')
- self.webapp.router.add_get('/panel', web.FileResponse(panel))
+ def get_panel():
+ """Return file response with panel."""
+ return web.FileResponse(panel)
+
+ self.webapp.router.add_get('/panel', get_panel)
async def start(self):
"""Run rest api webserver."""
