1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Adjust version comparison in HA Cloud account linking (#76978)

This commit is contained in:
Franck Nijhof
2022-08-18 14:06:50 +02:00
committed by GitHub
parent 1aef60c81c
commit c212fe7ca5
2 changed files with 16 additions and 1 deletions

View File

@@ -18,6 +18,9 @@ CACHE_TIMEOUT = 3600
_LOGGER = logging.getLogger(__name__)
CURRENT_VERSION = AwesomeVersion(HA_VERSION)
CURRENT_PLAIN_VERSION = AwesomeVersion(
CURRENT_VERSION.string.removesuffix(f"{CURRENT_VERSION.modifier}")
)
@callback
@@ -35,7 +38,7 @@ async def async_provide_implementation(hass: HomeAssistant, domain: str):
for service in services:
if (
service["service"] == domain
and CURRENT_VERSION >= service["min_version"]
and CURRENT_PLAIN_VERSION >= service["min_version"]
and (
service.get("accepts_new_authorizations", True)
or (