mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 01:56:34 +00:00
Fix Version detection with exists container (#1193)
This commit is contained in:
parent
b26dd0af19
commit
bc099f0d81
@ -76,20 +76,18 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
|
|||||||
|
|
||||||
async def load(self) -> None:
|
async def load(self) -> None:
|
||||||
"""Prepare Home Assistant object."""
|
"""Prepare Home Assistant object."""
|
||||||
with suppress(DockerAPIError):
|
try:
|
||||||
# Evaluate Version if we lost this information
|
# Evaluate Version if we lost this information
|
||||||
if not self.version:
|
if not self.version:
|
||||||
if await self.instance.is_running():
|
self.version = await self.instance.get_latest_version()
|
||||||
self.version = self.instance.version
|
|
||||||
else:
|
|
||||||
self.version = await self.instance.get_latest_version()
|
|
||||||
self.save_data()
|
|
||||||
|
|
||||||
await self.instance.attach(tag=self.version)
|
await self.instance.attach(tag=self.version)
|
||||||
return
|
except DockerAPIError:
|
||||||
|
_LOGGER.info("No Home Assistant Docker image %s found.", self.image)
|
||||||
_LOGGER.info("No Home Assistant Docker image %s found.", self.image)
|
await self.install_landingpage()
|
||||||
await self.install_landingpage()
|
else:
|
||||||
|
self.version = self.instance.version
|
||||||
|
self.save_data()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def machine(self) -> str:
|
def machine(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user