mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
commit
7841f14163
@ -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"
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user