diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 929334718..b1e6010d2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -16,7 +16,7 @@ "python.linting.enabled": true, "python.formatting.provider": "black", "python.formatting.blackArgs": [ - "--target--version", + "--target-version", "py37" ], "editor.formatOnPaste": false, @@ -24,4 +24,4 @@ "editor.formatOnType": true, "files.trimTrailingWhitespace": true } -} \ No newline at end of file +} diff --git a/hassio/const.py b/hassio/const.py index 69219c7ba..89bbaba54 100644 --- a/hassio/const.py +++ b/hassio/const.py @@ -3,7 +3,7 @@ from pathlib import Path from ipaddress import ip_network -HASSIO_VERSION = "171" +HASSIO_VERSION = "172" URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons" URL_HASSIO_VERSION = "https://version.home-assistant.io/{channel}.json" diff --git a/hassio/core.py b/hassio/core.py index 335dd9d80..91b391cdf 100644 --- a/hassio/core.py +++ b/hassio/core.py @@ -172,6 +172,7 @@ class HassIO(CoreSysAttributes): async def repair(self): """Repair system integrity.""" + _LOGGER.info("Start repairing of Hass.io Environment") await self.sys_run_in_executor(self.sys_docker.repair) # Restore core functionality @@ -184,3 +185,4 @@ class HassIO(CoreSysAttributes): # Tag version for latest await self.sys_supervisor.repair() + _LOGGER.info("Finished repairing of Hass.io Environment") diff --git a/hassio/homeassistant.py b/hassio/homeassistant.py index c4702b3a1..a30d72679 100644 --- a/hassio/homeassistant.py +++ b/hassio/homeassistant.py @@ -76,20 +76,18 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): async def load(self) -> None: """Prepare Home Assistant object.""" - with suppress(DockerAPIError): + try: # Evaluate Version if we lost this information if not self.version: - if await self.instance.is_running(): - self.version = self.instance.version - else: - self.version = await self.instance.get_latest_version() - self.save_data() + self.version = await self.instance.get_latest_version() await self.instance.attach(tag=self.version) - return - - _LOGGER.info("No Home Assistant Docker image %s found.", self.image) - await self.install_landingpage() + except DockerAPIError: + _LOGGER.info("No Home Assistant Docker image %s found.", self.image) + await self.install_landingpage() + else: + self.version = self.instance.version + self.save_data() @property def machine(self) -> str: