Add selfupdate task (#6)

Add an optional extended description…
This commit is contained in:
Pascal Vizeli 2017-04-19 17:51:48 +02:00 committed by GitHub
parent f9c7371140
commit cc63008a86
3 changed files with 16 additions and 2 deletions

View File

@ -13,6 +13,7 @@ DOCKER_REPO = "pvizeli"
HASSIO_SHARE = "/data"
RUN_UPDATE_INFO_TASKS = 28800
RUN_UPDATE_SUPERVISOR_TASKS = 29100
RUN_RELOAD_ADDONS_TASKS = 28800
RESTART_EXIT_CODE = 100

View File

@ -11,7 +11,7 @@ from .api import RestAPI
from .host_controll import HostControll
from .const import (
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 .dock.homeassistant import DockerHomeAssistant
from .dock.supervisor import DockerSupervisor
@ -87,6 +87,10 @@ class HassIO(object):
self.scheduler.register_task(
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):
"""Start HassIO orchestration."""
# start api
@ -129,3 +133,12 @@ class HassIO(object):
# store version
_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)

View File

@ -1,5 +1,5 @@
{
"hassio_tag": "0.7",
"hassio_tag": "0.8",
"homeassistant_tag": "0.42.3",
"resinos_version": "0.3",
"resinhup_version": "0.1"