mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-28 11:36:32 +00:00
Fix version conflict
This commit is contained in:
commit
9084ac119f
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,2 +0,0 @@
|
|||||||
# Ignore version on merge
|
|
||||||
version.json merge=ours
|
|
@ -202,8 +202,14 @@ class RestAPI(CoreSysAttributes):
|
|||||||
web.get('/panel_latest', create_response('hassio-main-latest')),
|
web.get('/panel_latest', create_response('hassio-main-latest')),
|
||||||
])
|
])
|
||||||
|
|
||||||
# This route is for HA > 0.61
|
# This route is for backwards compatibility with HA 0.62 - 0.70
|
||||||
self.webapp.add_routes([web.static('/app-es5', panel_dir)])
|
self.webapp.add_routes([
|
||||||
|
web.get('/app-es5/index.html', create_response('index')),
|
||||||
|
web.get('/app-es5/hassio-app.html', create_response('hassio-app')),
|
||||||
|
])
|
||||||
|
|
||||||
|
# This route is for HA > 0.70
|
||||||
|
self.webapp.add_routes([web.static('/app', panel_dir)])
|
||||||
|
|
||||||
async def start(self):
|
async def start(self):
|
||||||
"""Run rest api webserver."""
|
"""Run rest api webserver."""
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from ipaddress import ip_network
|
from ipaddress import ip_network
|
||||||
|
|
||||||
HASSIO_VERSION = '104'
|
HASSIO_VERSION = '105'
|
||||||
|
|
||||||
URL_HASSIO_VERSION = ('https://raw.githubusercontent.com/home-assistant/'
|
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
|
||||||
'hassio/{}/version.json')
|
URL_HASSIO_VERSION = \
|
||||||
|
"https://s3.amazonaws.com/hassio-version/{channel}.json"
|
||||||
URL_HASSIO_ADDONS = 'https://github.com/home-assistant/hassio-addons'
|
|
||||||
|
|
||||||
HASSIO_DATA = Path("/data")
|
HASSIO_DATA = Path("/data")
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class DockerAPI:
|
|||||||
"""Initialize docker base wrapper."""
|
"""Initialize docker base wrapper."""
|
||||||
self.docker = docker.DockerClient(
|
self.docker = docker.DockerClient(
|
||||||
base_url="unix:/{}".format(str(SOCKET_DOCKER)),
|
base_url="unix:/{}".format(str(SOCKET_DOCKER)),
|
||||||
version='auto', timeout=300)
|
version='auto', timeout=900)
|
||||||
self.network = DockerNetwork(self.docker)
|
self.network = DockerNetwork(self.docker)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
"""Fetch last versions from webserver."""
|
"""Fetch last versions from webserver."""
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from contextlib import suppress
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import async_timeout
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
URL_HASSIO_VERSION, FILE_HASSIO_UPDATER, ATTR_HOMEASSISTANT, ATTR_HASSIO,
|
URL_HASSIO_VERSION, FILE_HASSIO_UPDATER, ATTR_HOMEASSISTANT, ATTR_HASSIO,
|
||||||
ATTR_CHANNEL, CHANNEL_STABLE, CHANNEL_BETA, CHANNEL_DEV)
|
ATTR_CHANNEL)
|
||||||
from .coresys import CoreSysAttributes
|
from .coresys import CoreSysAttributes
|
||||||
from .utils import AsyncThrottle
|
from .utils import AsyncThrottle
|
||||||
from .utils.json import JsonConfig
|
from .utils.json import JsonConfig
|
||||||
@ -17,12 +17,6 @@ from .validate import SCHEMA_UPDATER_CONFIG
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
CHANNEL_TO_BRANCH = {
|
|
||||||
CHANNEL_STABLE: 'master',
|
|
||||||
CHANNEL_BETA: 'rc',
|
|
||||||
CHANNEL_DEV: 'dev',
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class Updater(JsonConfig, CoreSysAttributes):
|
class Updater(JsonConfig, CoreSysAttributes):
|
||||||
"""Fetch last versions from version.json."""
|
"""Fetch last versions from version.json."""
|
||||||
@ -65,11 +59,10 @@ class Updater(JsonConfig, CoreSysAttributes):
|
|||||||
|
|
||||||
Is a coroutine.
|
Is a coroutine.
|
||||||
"""
|
"""
|
||||||
url = URL_HASSIO_VERSION.format(CHANNEL_TO_BRANCH[self.channel])
|
url = URL_HASSIO_VERSION.format(channel=self.channel)
|
||||||
try:
|
try:
|
||||||
_LOGGER.info("Fetch update data from %s", url)
|
_LOGGER.info("Fetch update data from %s", url)
|
||||||
with async_timeout.timeout(10):
|
async with self.sys_websession.get(url, timeout=10) as request:
|
||||||
async with self.sys_websession.get(url) as request:
|
|
||||||
data = await request.json(content_type=None)
|
data = await request.json(content_type=None)
|
||||||
|
|
||||||
except (aiohttp.ClientError, asyncio.TimeoutError, KeyError) as err:
|
except (aiohttp.ClientError, asyncio.TimeoutError, KeyError) as err:
|
||||||
@ -81,11 +74,18 @@ class Updater(JsonConfig, CoreSysAttributes):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# data valid?
|
# data valid?
|
||||||
if not data:
|
if not data or data.get(ATTR_CHANNEL) != self.channel:
|
||||||
_LOGGER.warning("Invalid data from %s", url)
|
_LOGGER.warning("Invalid data from %s", url)
|
||||||
return
|
return
|
||||||
|
|
||||||
# update versions
|
# update supervisor versions
|
||||||
self._data[ATTR_HOMEASSISTANT] = data.get('homeassistant')
|
with suppress(KeyError):
|
||||||
self._data[ATTR_HASSIO] = data.get('hassio')
|
self._data[ATTR_HASSIO] = data['supervisor']
|
||||||
|
|
||||||
|
# update Home Assistant version
|
||||||
|
machine = self.sys_machine or 'default'
|
||||||
|
with suppress(KeyError):
|
||||||
|
self._data[ATTR_HOMEASSISTANT] = \
|
||||||
|
data['homeassistant'][machine]
|
||||||
|
|
||||||
self.save_data()
|
self.save_data()
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
{
|
{
|
||||||
"hassio": "103.3",
|
"hassio": "105",
|
||||||
"homeassistant": "0.70.0",
|
"homeassistant": "0.70.0"
|
||||||
"resinos": "1.3",
|
|
||||||
"resinhup": "0.3",
|
|
||||||
"generic": "0.3",
|
|
||||||
"cluster": "0.1"
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user