mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-22 00:26:29 +00:00
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
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -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."""
|
"""Init file for HassIO rest api."""
|
||||||
import logging
|
import logging
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from aiohttp import web
|
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/totp', api_security.totp)
|
||||||
self.webapp.router.add_post('/security/session', api_security.session)
|
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):
|
async def start(self):
|
||||||
"""Run rest api webserver."""
|
"""Run rest api webserver."""
|
||||||
self._handler = self.webapp.make_handler(loop=self.loop)
|
self._handler = self.webapp.make_handler(loop=self.loop)
|
||||||
|
BIN
hassio/panel/hassio-main.html.gz
Normal file
BIN
hassio/panel/hassio-main.html.gz
Normal file
Binary file not shown.
1
home-assistant-polymer
Submodule
1
home-assistant-polymer
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit a341ccf9440fc2028dff54d569e7f5897bf42b2f
|
Loading…
x
Reference in New Issue
Block a user