Fix account link version check (#28770)
This commit is contained in:
parent
ea0bae2d1b
commit
2cf86a3554
1 changed files with 14 additions and 2 deletions
|
@ -13,7 +13,6 @@ from .const import DOMAIN
|
|||
|
||||
DATA_SERVICES = "cloud_account_link_services"
|
||||
CACHE_TIMEOUT = 3600
|
||||
PATCH_VERSION = int(PATCH_VERSION.split(".")[0])
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -49,7 +48,20 @@ def _is_older(version: str) -> bool:
|
|||
except ValueError:
|
||||
return False
|
||||
|
||||
cur_version_parts = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION]
|
||||
patch_number_str = ""
|
||||
|
||||
for char in PATCH_VERSION:
|
||||
if char.isnumeric():
|
||||
patch_number_str += char
|
||||
else:
|
||||
break
|
||||
|
||||
try:
|
||||
patch_number = int(patch_number_str)
|
||||
except ValueError:
|
||||
patch_number = 0
|
||||
|
||||
cur_version_parts = [MAJOR_VERSION, MINOR_VERSION, patch_number]
|
||||
|
||||
return version_parts <= cur_version_parts
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue