From 4f0ced4d9a696a7553a70363fc7291640fb34510 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 27 Oct 2024 17:37:14 +0100 Subject: [PATCH] bundles/homeassistant: fix version check --- bundles/homeassistant/files/check_homeassistant_update | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/homeassistant/files/check_homeassistant_update b/bundles/homeassistant/files/check_homeassistant_update index 0e6f2e8..853c467 100644 --- a/bundles/homeassistant/files/check_homeassistant_update +++ b/bundles/homeassistant/files/check_homeassistant_update @@ -2,7 +2,7 @@ from sys import exit -from packaging import version +from packaging.version import parse from requests import get API_TOKEN = "${token}" @@ -11,7 +11,7 @@ DOMAIN = "${domain}" try: r = get("https://version.home-assistant.io/stable.json") r.raise_for_status() - stable_version = r.json()["homeassistant"]["generic-x86-64"] + stable_version = parse(r.json()["homeassistant"]["generic-x86-64"]) except Exception as e: print(f"Could not get stable version information from home-assistant.io: {e!r}") exit(3) @@ -22,7 +22,7 @@ try: headers={"Authorization": f"Bearer {API_TOKEN}", "Content-Type": "application/json"}, ) r.raise_for_status() - running_version = r.json()["version"] + running_version = parse(r.json()["version"]) except Exception as e: print(f"Could not get running version information from homeassistant: {e!r}") exit(3)