WIP Add panel to hass.io (#46)

* Add poliymare

* Add commit

* add static route

* fix name

* add panel
This commit is contained in:
Pascal Vizeli 2017-05-13 17:41:46 +02:00 committed by GitHub
parent 35fe1f464c
commit affd8057ca
4 changed files with 12 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "home-assistant-polymer"]
path = home-assistant-polymer
url = https://github.com/home-assistant/home-assistant-polymer

View File

@ -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