Merge pull request #1671 from home-assistant/dev

Release 219
This commit is contained in:
Pascal Vizeli 2020-04-22 11:31:50 +02:00 committed by GitHub
commit 7841f14163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 6 deletions

View File

@ -3,7 +3,7 @@ from enum import Enum
from ipaddress import ip_network
from pathlib import Path
SUPERVISOR_VERSION = "218"
SUPERVISOR_VERSION = "219"
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"

View File

@ -34,9 +34,6 @@ class Core(CoreSysAttributes):
"""Setup supervisor orchestration."""
self.state = CoreStates.STARTUP
# load last available data
await self.sys_updater.load()
# Load DBus
await self.sys_dbus.load()
@ -46,6 +43,9 @@ class Core(CoreSysAttributes):
# Load Plugins container
await self.sys_plugins.load()
# load last available data
await self.sys_updater.load()
# Load Home Assistant
await self.sys_homeassistant.load()

View File

@ -251,6 +251,14 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
"""Install a landing page."""
_LOGGER.info("Setup HomeAssistant landingpage")
while True:
if not self.sys_updater.image_homeassistant:
_LOGGER.warning(
"Found no information about Home Assistant. Retry in 15sec"
)
await asyncio.sleep(15)
await self.sys_updater.reload()
continue
try:
await self.instance.install(
"landingpage", image=self.sys_updater.image_homeassistant

View File

@ -11,6 +11,8 @@ from ..exceptions import JsonFileError
_LOGGER: logging.Logger = logging.getLogger(__name__)
_DEFAULT: Dict[str, Any] = {}
def write_json_file(jsonfile: Path, data: Any) -> None:
"""Write a JSON file."""
@ -37,7 +39,7 @@ class JsonConfig:
"""Initialize hass object."""
self._file: Path = json_file
self._schema: vol.Schema = schema
self._data: Dict[str, Any] = {}
self._data: Dict[str, Any] = _DEFAULT
self.read_data()
@ -68,7 +70,7 @@ class JsonConfig:
# Reset data to default
_LOGGER.warning("Reset %s to default", self._file)
self._data = self._schema({})
self._data = self._schema(_DEFAULT)
def save_data(self) -> None:
"""Store data to configuration file."""
@ -80,6 +82,7 @@ class JsonConfig:
# Load last valid data
_LOGGER.warning("Reset %s to last version", self._file)
self._data = _DEFAULT
self.read_data()
else:
# write