mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-22 00:26:29 +00:00
Add the current supervisor version as default (#1791)
* Add the current supervisor version as default * Fix lint * Improve new version handling
This commit is contained in:
parent
e27c5dad15
commit
351c45da75
@ -3,7 +3,7 @@ from datetime import datetime
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path, PurePath
|
||||
from typing import List, Optional
|
||||
from typing import List
|
||||
|
||||
from .const import (
|
||||
ATTR_ADDONS_CUSTOM_LIST,
|
||||
@ -62,9 +62,9 @@ class CoreConfig(JsonConfig):
|
||||
self._data[ATTR_TIMEZONE] = value
|
||||
|
||||
@property
|
||||
def version(self) -> Optional[str]:
|
||||
def version(self) -> str:
|
||||
"""Return config version."""
|
||||
return self._data.get(ATTR_VERSION)
|
||||
return self._data[ATTR_VERSION]
|
||||
|
||||
@version.setter
|
||||
def version(self, value: str) -> None:
|
||||
|
@ -28,10 +28,7 @@ class Core(CoreSysAttributes):
|
||||
# If a update is failed?
|
||||
if self.sys_dev:
|
||||
self.sys_config.version = self.sys_supervisor.version
|
||||
elif (
|
||||
self.sys_config.version
|
||||
and self.sys_config.version != self.sys_supervisor.version
|
||||
):
|
||||
elif self.sys_config.version != self.sys_supervisor.version:
|
||||
self.healthy = False
|
||||
_LOGGER.critical("Update of Supervisor fails!")
|
||||
|
||||
|
@ -37,6 +37,7 @@ from .const import (
|
||||
ATTR_WAIT_BOOT,
|
||||
ATTR_WATCHDOG,
|
||||
LogLevel,
|
||||
SUPERVISOR_VERSION,
|
||||
UpdateChannels,
|
||||
)
|
||||
from .utils.validate import validate_timezone
|
||||
@ -176,7 +177,7 @@ SCHEMA_SUPERVISOR_CONFIG = vol.Schema(
|
||||
{
|
||||
vol.Optional(ATTR_TIMEZONE, default="UTC"): validate_timezone,
|
||||
vol.Optional(ATTR_LAST_BOOT): vol.Coerce(str),
|
||||
vol.Optional(ATTR_VERSION): simple_version,
|
||||
vol.Optional(ATTR_VERSION, default=SUPERVISOR_VERSION): simple_version,
|
||||
vol.Optional(
|
||||
ATTR_ADDONS_CUSTOM_LIST,
|
||||
default=["https://github.com/hassio-addons/repository"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user