mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-17 14:16:29 +00:00
some cleanup more
This commit is contained in:
parent
e5e25c895f
commit
05980d4147
@ -4,7 +4,7 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from .utils import api_process_hostcontrol, api_process, api_validate
|
||||
from .utils import api_process, api_validate
|
||||
from ..const import (
|
||||
ATTR_VERSION, ATTR_LAST_VERSION, ATTR_TYPE, ATTR_HOSTNAME, ATTR_FEATURES,
|
||||
ATTR_OS)
|
||||
@ -24,31 +24,30 @@ class APIHost(CoreSysAttributes):
|
||||
async def info(self, request):
|
||||
"""Return host information."""
|
||||
return {
|
||||
ATTR_TYPE: self._host_control.type,
|
||||
ATTR_VERSION: self._host_control.version,
|
||||
ATTR_LAST_VERSION: self._host_control.last_version,
|
||||
ATTR_FEATURES: self._host_control.features,
|
||||
ATTR_HOSTNAME: self._host_control.hostname,
|
||||
ATTR_OS: self._host_control.os_info,
|
||||
ATTR_TYPE: ,
|
||||
ATTR_VERSION: ,
|
||||
ATTR_LAST_VERSION: ,
|
||||
ATTR_FEATURES: self.sys_host.features,
|
||||
ATTR_HOSTNAME: ,
|
||||
ATTR_OS: ,
|
||||
}
|
||||
|
||||
@api_process_hostcontrol
|
||||
@api_process
|
||||
def reboot(self, request):
|
||||
"""Reboot host."""
|
||||
return self._host_control.reboot()
|
||||
return self.sys_host.power.reboot()
|
||||
|
||||
@api_process_hostcontrol
|
||||
@api_process
|
||||
def shutdown(self, request):
|
||||
"""Poweroff host."""
|
||||
return self._host_control.shutdown()
|
||||
return self.sys_host.power.shutdown()
|
||||
|
||||
@api_process_hostcontrol
|
||||
async def reload(self, request):
|
||||
@api_process
|
||||
def reload(self, request):
|
||||
"""Reload host data."""
|
||||
await self._host_control.load()
|
||||
return True
|
||||
return self._host_control.load()
|
||||
|
||||
@api_process_hostcontrol
|
||||
@api_process
|
||||
async def update(self, request):
|
||||
"""Update host OS."""
|
||||
body = await api_validate(SCHEMA_VERSION, request)
|
||||
|
@ -41,3 +41,7 @@ class HostManager(CoreSysAttributes):
|
||||
async def load(self):
|
||||
"""Load host functions."""
|
||||
pass
|
||||
|
||||
async def reload(self):
|
||||
"""Reload host information."""
|
||||
pass
|
||||
|
@ -15,7 +15,7 @@ class Tasks(CoreSysAttributes):
|
||||
|
||||
RUN_RELOAD_ADDONS = 21600
|
||||
RUN_RELOAD_SNAPSHOTS = 72000
|
||||
RUN_RELOAD_HOST_CONTROL = 72000
|
||||
RUN_RELOAD_HOST = 72000
|
||||
RUN_RELOAD_UPDATER = 21600
|
||||
|
||||
RUN_WATCHDOG_HOMEASSISTANT_DOCKER = 15
|
||||
@ -41,7 +41,7 @@ class Tasks(CoreSysAttributes):
|
||||
self.jobs.add(self.sys_scheduler.register_task(
|
||||
self.sys_snapshots.reload, self.RUN_RELOAD_SNAPSHOTS))
|
||||
self.jobs.add(self.sys_scheduler.register_task(
|
||||
self._host_control.load, self.RUN_RELOAD_HOST_CONTROL))
|
||||
self.sys_host.load, self.RUN_RELOAD_HOST))
|
||||
|
||||
self.jobs.add(self.sys_scheduler.register_task(
|
||||
self._watchdog_homeassistant_docker,
|
||||
|
Loading…
x
Reference in New Issue
Block a user