mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 18:26:30 +00:00
Stage API
This commit is contained in:
parent
0dd7f8fbaa
commit
b95ab3e95a
@ -7,6 +7,7 @@ from aiohttp import web
|
|||||||
from .addons import APIAddons
|
from .addons import APIAddons
|
||||||
from .discovery import APIDiscovery
|
from .discovery import APIDiscovery
|
||||||
from .homeassistant import APIHomeAssistant
|
from .homeassistant import APIHomeAssistant
|
||||||
|
from .hardware import APIHardware
|
||||||
from .host import APIHost
|
from .host import APIHost
|
||||||
from .network import APINetwork
|
from .network import APINetwork
|
||||||
from .proxy import APIProxy
|
from .proxy import APIProxy
|
||||||
@ -37,6 +38,7 @@ class RestAPI(CoreSysAttributes):
|
|||||||
"""Register REST API Calls."""
|
"""Register REST API Calls."""
|
||||||
self._register_supervisor()
|
self._register_supervisor()
|
||||||
self._register_host()
|
self._register_host()
|
||||||
|
self._register_hardware()
|
||||||
self._register_homeassistant()
|
self._register_homeassistant()
|
||||||
self._register_proxy()
|
self._register_proxy()
|
||||||
self._register_panel()
|
self._register_panel()
|
||||||
@ -53,7 +55,6 @@ class RestAPI(CoreSysAttributes):
|
|||||||
|
|
||||||
self.webapp.add_routes([
|
self.webapp.add_routes([
|
||||||
web.get('/host/info', api_host.info),
|
web.get('/host/info', api_host.info),
|
||||||
web.get('/host/hardware', api_host.hardware),
|
|
||||||
web.post('/host/reboot', api_host.reboot),
|
web.post('/host/reboot', api_host.reboot),
|
||||||
web.post('/host/shutdown', api_host.shutdown),
|
web.post('/host/shutdown', api_host.shutdown),
|
||||||
web.post('/host/update', api_host.update),
|
web.post('/host/update', api_host.update),
|
||||||
@ -71,6 +72,16 @@ class RestAPI(CoreSysAttributes):
|
|||||||
web.post('/network/options', api_net.options),
|
web.post('/network/options', api_net.options),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def _register_hardware(self):
|
||||||
|
"""Register hardware function."""
|
||||||
|
api_hardware = APIHardware()
|
||||||
|
api_hardware.coresys = self.coresys
|
||||||
|
|
||||||
|
self.webapp.add_routes([
|
||||||
|
web.get('/network/info', api_hardware.info),
|
||||||
|
web.get('/network/audio', api_hardware.audio),
|
||||||
|
])
|
||||||
|
|
||||||
def _register_supervisor(self):
|
def _register_supervisor(self):
|
||||||
"""Register supervisor function."""
|
"""Register supervisor function."""
|
||||||
api_supervisor = APISupervisor()
|
api_supervisor = APISupervisor()
|
||||||
|
@ -16,6 +16,7 @@ SCHEMA_VERSION = vol.Schema({
|
|||||||
vol.Optional(ATTR_VERSION): vol.Coerce(str),
|
vol.Optional(ATTR_VERSION): vol.Coerce(str),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class APIHost(CoreSysAttributes):
|
class APIHost(CoreSysAttributes):
|
||||||
"""Handle rest api for host functions."""
|
"""Handle rest api for host functions."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user