mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-16 21:56:29 +00:00
Ignore version on supervisor update (#2840)
* Ignore version on supervisor update * fix property
This commit is contained in:
parent
29e55d3664
commit
b97e33f5d5
@ -197,10 +197,18 @@ class APISupervisor(CoreSysAttributes):
|
|||||||
async def update(self, request: web.Request) -> None:
|
async def update(self, request: web.Request) -> None:
|
||||||
"""Update Supervisor OS."""
|
"""Update Supervisor OS."""
|
||||||
body = await api_validate(SCHEMA_VERSION, request)
|
body = await api_validate(SCHEMA_VERSION, request)
|
||||||
version = body.get(ATTR_VERSION, self.sys_updater.version_supervisor)
|
|
||||||
|
|
||||||
if version == self.sys_supervisor.version:
|
# This option is useless outside of DEV
|
||||||
raise APIError(f"Version {version} is already in use")
|
if not self.sys_dev and not self.sys_supervisor.need_update:
|
||||||
|
raise APIError(
|
||||||
|
f"No supervisor update available - {self.sys_supervisor.version!s}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if self.sys_dev:
|
||||||
|
version = body.get(ATTR_VERSION, self.sys_updater.version_supervisor)
|
||||||
|
else:
|
||||||
|
version = self.sys_updater.version_supervisor
|
||||||
|
|
||||||
await asyncio.shield(self.sys_supervisor.update(version))
|
await asyncio.shield(self.sys_supervisor.update(version))
|
||||||
|
|
||||||
@api_process
|
@api_process
|
||||||
|
Loading…
x
Reference in New Issue
Block a user