mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 02:56:31 +00:00
commit
7841f14163
@ -3,7 +3,7 @@ from enum import Enum
|
|||||||
from ipaddress import ip_network
|
from ipaddress import ip_network
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
SUPERVISOR_VERSION = "218"
|
SUPERVISOR_VERSION = "219"
|
||||||
|
|
||||||
|
|
||||||
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
|
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
|
||||||
|
@ -34,9 +34,6 @@ class Core(CoreSysAttributes):
|
|||||||
"""Setup supervisor orchestration."""
|
"""Setup supervisor orchestration."""
|
||||||
self.state = CoreStates.STARTUP
|
self.state = CoreStates.STARTUP
|
||||||
|
|
||||||
# load last available data
|
|
||||||
await self.sys_updater.load()
|
|
||||||
|
|
||||||
# Load DBus
|
# Load DBus
|
||||||
await self.sys_dbus.load()
|
await self.sys_dbus.load()
|
||||||
|
|
||||||
@ -46,6 +43,9 @@ class Core(CoreSysAttributes):
|
|||||||
# Load Plugins container
|
# Load Plugins container
|
||||||
await self.sys_plugins.load()
|
await self.sys_plugins.load()
|
||||||
|
|
||||||
|
# load last available data
|
||||||
|
await self.sys_updater.load()
|
||||||
|
|
||||||
# Load Home Assistant
|
# Load Home Assistant
|
||||||
await self.sys_homeassistant.load()
|
await self.sys_homeassistant.load()
|
||||||
|
|
||||||
|
@ -251,6 +251,14 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
|
|||||||
"""Install a landing page."""
|
"""Install a landing page."""
|
||||||
_LOGGER.info("Setup HomeAssistant landingpage")
|
_LOGGER.info("Setup HomeAssistant landingpage")
|
||||||
while True:
|
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:
|
try:
|
||||||
await self.instance.install(
|
await self.instance.install(
|
||||||
"landingpage", image=self.sys_updater.image_homeassistant
|
"landingpage", image=self.sys_updater.image_homeassistant
|
||||||
|
@ -11,6 +11,8 @@ from ..exceptions import JsonFileError
|
|||||||
|
|
||||||
_LOGGER: logging.Logger = logging.getLogger(__name__)
|
_LOGGER: logging.Logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
_DEFAULT: Dict[str, Any] = {}
|
||||||
|
|
||||||
|
|
||||||
def write_json_file(jsonfile: Path, data: Any) -> None:
|
def write_json_file(jsonfile: Path, data: Any) -> None:
|
||||||
"""Write a JSON file."""
|
"""Write a JSON file."""
|
||||||
@ -37,7 +39,7 @@ class JsonConfig:
|
|||||||
"""Initialize hass object."""
|
"""Initialize hass object."""
|
||||||
self._file: Path = json_file
|
self._file: Path = json_file
|
||||||
self._schema: vol.Schema = schema
|
self._schema: vol.Schema = schema
|
||||||
self._data: Dict[str, Any] = {}
|
self._data: Dict[str, Any] = _DEFAULT
|
||||||
|
|
||||||
self.read_data()
|
self.read_data()
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ class JsonConfig:
|
|||||||
|
|
||||||
# Reset data to default
|
# Reset data to default
|
||||||
_LOGGER.warning("Reset %s to default", self._file)
|
_LOGGER.warning("Reset %s to default", self._file)
|
||||||
self._data = self._schema({})
|
self._data = self._schema(_DEFAULT)
|
||||||
|
|
||||||
def save_data(self) -> None:
|
def save_data(self) -> None:
|
||||||
"""Store data to configuration file."""
|
"""Store data to configuration file."""
|
||||||
@ -80,6 +82,7 @@ class JsonConfig:
|
|||||||
|
|
||||||
# Load last valid data
|
# Load last valid data
|
||||||
_LOGGER.warning("Reset %s to last version", self._file)
|
_LOGGER.warning("Reset %s to last version", self._file)
|
||||||
|
self._data = _DEFAULT
|
||||||
self.read_data()
|
self.read_data()
|
||||||
else:
|
else:
|
||||||
# write
|
# write
|
||||||
|
Loading…
x
Reference in New Issue
Block a user