WIP Add panel to hass.io (#46)
* Add poliymare * Add commit * add static route * fix name * add panel
This commit is contained in:
parent
35fe1f464c
commit
affd8057ca
|
@ -0,0 +1,3 @@
|
|||
[submodule "home-assistant-polymer"]
|
||||
path = home-assistant-polymer
|
||||
url = https://github.com/home-assistant/home-assistant-polymer
|
|
@ -1,5 +1,6 @@
|
|||
"""Init file for HassIO rest api."""
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from aiohttp import web
|
||||
|
||||
|
@ -96,6 +97,13 @@ class RestAPI(object):
|
|||
self.webapp.router.add_post('/security/totp', api_security.totp)
|
||||
self.webapp.router.add_post('/security/session', api_security.session)
|
||||
|
||||
def register_panel(self):
|
||||
"""Register panel for homeassistant."""
|
||||
panel_dir = Path(__file__).parents[1].joinpath('panel')
|
||||
|
||||
self.webapp.router.register_resource(
|
||||
web.StaticResource('/panel', str(panel_dir)))
|
||||
|
||||
async def start(self):
|
||||
"""Run rest api webserver."""
|
||||
self._handler = self.webapp.make_handler(loop=self.loop)
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
Subproject commit a341ccf9440fc2028dff54d569e7f5897bf42b2f
|
Loading…
Reference in New Issue