mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-16 13:46:31 +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:
|
||||
"""Update Supervisor OS."""
|
||||
body = await api_validate(SCHEMA_VERSION, request)
|
||||
version = body.get(ATTR_VERSION, self.sys_updater.version_supervisor)
|
||||
|
||||
if version == self.sys_supervisor.version:
|
||||
raise APIError(f"Version {version} is already in use")
|
||||
# This option is useless outside of DEV
|
||||
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))
|
||||
|
||||
@api_process
|
||||
|
Loading…
x
Reference in New Issue
Block a user