Skip to content
Snippets Groups Projects
Unverified Commit 2cf86a35 authored by Paulus Schoutsen's avatar Paulus Schoutsen Committed by GitHub
Browse files

Fix account link version check (#28770)

parent ea0bae2d
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,6 @@ from .const import DOMAIN ...@@ -13,7 +13,6 @@ from .const import DOMAIN
DATA_SERVICES = "cloud_account_link_services" DATA_SERVICES = "cloud_account_link_services"
CACHE_TIMEOUT = 3600 CACHE_TIMEOUT = 3600
PATCH_VERSION = int(PATCH_VERSION.split(".")[0])
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
...@@ -49,7 +48,20 @@ def _is_older(version: str) -> bool: ...@@ -49,7 +48,20 @@ def _is_older(version: str) -> bool:
except ValueError: except ValueError:
return False 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 return version_parts <= cur_version_parts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment