Use tmp folder / fix log bug / add executor (#83)

* Use tmp folder / fix log bug / add executor

* Update __main__.py

* Update .travis.yml

* Add autoupdate on startup.

* Fix bug

* Move selfupdate code part into start
This commit is contained in:
Pascal Vizeli
2017-06-28 16:22:44 +02:00
committed by GitHub
parent 40343089b5
commit d5eb66bc0d
11 changed files with 86 additions and 57 deletions

View File

@@ -18,10 +18,11 @@ def api_sessions_cleanup(config):
return _api_sessions_cleanup
def hassio_update(config, supervisor):
def hassio_update(config, supervisor, websession):
"""Create scheduler task for update of supervisor hassio."""
async def _hassio_update():
"""Check and run update of supervisor hassio."""
await config.fetch_update_infos(websession)
if config.last_hassio == supervisor.version:
return
@@ -43,12 +44,12 @@ def homeassistant_watchdog(loop, homeassistant):
return _homeassistant_watchdog
async def homeassistant_setup(config, loop, homeassistant):
async def homeassistant_setup(config, loop, homeassistant, websession):
"""Install a homeassistant docker container."""
while True:
# read homeassistant tag and install it
if not config.last_homeassistant:
await config.fetch_update_infos()
await config.fetch_update_infos(websession)
tag = config.last_homeassistant
if tag and await homeassistant.install(tag):