Skip to content

Commit

Permalink
home-assistant-custom-components.homematicip_local: fail if Home Assi…
Browse files Browse the repository at this point in the history
…stant is too old
  • Loading branch information
dotlambda committed Dec 15, 2024
1 parent 7211564 commit d70e297
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
buildHomeAssistantComponent,
fetchFromGitHub,
hahomematic,
home-assistant,
}:

buildHomeAssistantComponent rec {
Expand All @@ -17,6 +18,13 @@ buildHomeAssistantComponent rec {
hash = "sha256-1ssmaX6G03i9KYgjCRMZqOG2apEZ0069fQnmVy2BVhA=";
};

postPatch = ''
min_ha_version="$(sed -nr 's/^HMIP_LOCAL_MIN_HA_VERSION.*= "([0-9.]+)"$/\1/p' custom_components/homematicip_local/const.py)"
test \
"$(printf '%s\n' "$min_ha_version" "${home-assistant.version}" | sort -V | head -n1)" = "$min_ha_version" \
|| (echo "error: only Home Assistant >= $min_ha_version is supported" && exit 1)
'';

dependencies = [
hahomematic
];
Expand Down

0 comments on commit d70e297

Please sign in to comment.