mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 20:26:29 +00:00
parent
f9c7371140
commit
cc63008a86
@ -13,6 +13,7 @@ DOCKER_REPO = "pvizeli"
|
|||||||
HASSIO_SHARE = "/data"
|
HASSIO_SHARE = "/data"
|
||||||
|
|
||||||
RUN_UPDATE_INFO_TASKS = 28800
|
RUN_UPDATE_INFO_TASKS = 28800
|
||||||
|
RUN_UPDATE_SUPERVISOR_TASKS = 29100
|
||||||
RUN_RELOAD_ADDONS_TASKS = 28800
|
RUN_RELOAD_ADDONS_TASKS = 28800
|
||||||
|
|
||||||
RESTART_EXIT_CODE = 100
|
RESTART_EXIT_CODE = 100
|
||||||
|
@ -11,7 +11,7 @@ from .api import RestAPI
|
|||||||
from .host_controll import HostControll
|
from .host_controll import HostControll
|
||||||
from .const import (
|
from .const import (
|
||||||
SOCKET_DOCKER, RUN_UPDATE_INFO_TASKS, RUN_RELOAD_ADDONS_TASKS,
|
SOCKET_DOCKER, RUN_UPDATE_INFO_TASKS, RUN_RELOAD_ADDONS_TASKS,
|
||||||
STARTUP_AFTER, STARTUP_BEFORE)
|
RUN_UPDATE_SUPERVISOR_TASKS, STARTUP_AFTER, STARTUP_BEFORE)
|
||||||
from .scheduler import Scheduler
|
from .scheduler import Scheduler
|
||||||
from .dock.homeassistant import DockerHomeAssistant
|
from .dock.homeassistant import DockerHomeAssistant
|
||||||
from .dock.supervisor import DockerSupervisor
|
from .dock.supervisor import DockerSupervisor
|
||||||
@ -87,6 +87,10 @@ class HassIO(object):
|
|||||||
self.scheduler.register_task(
|
self.scheduler.register_task(
|
||||||
self.addons.relaod, RUN_RELOAD_ADDONS_TASKS, first_run=True)
|
self.addons.relaod, RUN_RELOAD_ADDONS_TASKS, first_run=True)
|
||||||
|
|
||||||
|
# schedule self update task
|
||||||
|
self.scheduler.register_task(
|
||||||
|
self._hassio_update, RUN_UPDATE_SUPERVISOR_TASKS)
|
||||||
|
|
||||||
async def start(self):
|
async def start(self):
|
||||||
"""Start HassIO orchestration."""
|
"""Start HassIO orchestration."""
|
||||||
# start api
|
# start api
|
||||||
@ -129,3 +133,12 @@ class HassIO(object):
|
|||||||
|
|
||||||
# store version
|
# store version
|
||||||
_LOGGER.info("HomeAssistant docker now installed.")
|
_LOGGER.info("HomeAssistant docker now installed.")
|
||||||
|
|
||||||
|
async def _hassio_update(self):
|
||||||
|
"""Check and run update of supervisor hassio."""
|
||||||
|
if self.config.current_hassio == self.supervisor.version:
|
||||||
|
return
|
||||||
|
|
||||||
|
_LOGGER.info(
|
||||||
|
"Found new HassIO version %s.", self.config.current_hassio)
|
||||||
|
await self.supervisor.update(self.config.current_hassio)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"hassio_tag": "0.7",
|
"hassio_tag": "0.8",
|
||||||
"homeassistant_tag": "0.42.3",
|
"homeassistant_tag": "0.42.3",
|
||||||
"resinos_version": "0.3",
|
"resinos_version": "0.3",
|
||||||
"resinhup_version": "0.1"
|
"resinhup_version": "0.1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user