mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-08 01:36:29 +00:00
fix self update style on startup (#85)
* fix self update style on startup * Check beta/dev upstream on update function
This commit is contained in:
parent
a33d765776
commit
0ed48a7741
@ -1,4 +1,5 @@
|
|||||||
"""Main file for HassIO."""
|
"""Main file for HassIO."""
|
||||||
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
@ -113,11 +114,10 @@ class HassIO(object):
|
|||||||
"""Start HassIO orchestration."""
|
"""Start HassIO orchestration."""
|
||||||
# on release channel, try update itself
|
# on release channel, try update itself
|
||||||
# on beta channel, only read new versions
|
# on beta channel, only read new versions
|
||||||
if not self.config.upstream_beta:
|
await asyncio.wait(
|
||||||
await self.loop.create_task(
|
[hassio_update(self.config, self.supervisor, self.websession)()],
|
||||||
hassio_update(self.config, self.supervisor, self.websession)())
|
loop=self.loop
|
||||||
else:
|
)
|
||||||
await self.config.fetch_update_infos(self.websession)
|
|
||||||
|
|
||||||
# start api
|
# start api
|
||||||
await self.api.start()
|
await self.api.start()
|
||||||
|
@ -26,6 +26,11 @@ def hassio_update(config, supervisor, websession):
|
|||||||
if config.last_hassio == supervisor.version:
|
if config.last_hassio == supervisor.version:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# don't perform a update on beta/dev channel
|
||||||
|
if config.upstream_beta:
|
||||||
|
_LOGGER.warning("Ignore Hass.IO update on beta upstream!")
|
||||||
|
return
|
||||||
|
|
||||||
_LOGGER.info("Found new HassIO version %s.", config.last_hassio)
|
_LOGGER.info("Found new HassIO version %s.", config.last_hassio)
|
||||||
await supervisor.update(config.last_hassio)
|
await supervisor.update(config.last_hassio)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user