about summary refs log tree commit diff
path: root/pkgs/servers/home-assistant/custom-components/smartir/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/home-assistant/custom-components/smartir/default.nix')
-rw-r--r--pkgs/servers/home-assistant/custom-components/smartir/default.nix24
1 files changed, 19 insertions, 5 deletions
diff --git a/pkgs/servers/home-assistant/custom-components/smartir/default.nix b/pkgs/servers/home-assistant/custom-components/smartir/default.nix
index 5dc9eb2473d72..876579639b647 100644
--- a/pkgs/servers/home-assistant/custom-components/smartir/default.nix
+++ b/pkgs/servers/home-assistant/custom-components/smartir/default.nix
@@ -1,8 +1,11 @@
-{ lib
-, buildHomeAssistantComponent
-, fetchFromGitHub
-, aiofiles
-, broadlink
+{
+  lib,
+  buildHomeAssistantComponent,
+  fetchFromGitHub,
+  fetchpatch,
+  aiofiles,
+  broadlink,
+  nix-update-script,
 }:
 
 buildHomeAssistantComponent rec {
@@ -17,6 +20,15 @@ buildHomeAssistantComponent rec {
     hash = "sha256-E6TM761cuaeQzlbjA+oZ+wt5HTJAfkF2J3i4P1Wbuic=";
   };
 
+  patches = [
+    # Replace distutils.version.StrictVersion with packaging.version.Version
+    # https://github.com/smartHomeHub/SmartIR/pull/1250
+    (fetchpatch {
+      url = "https://github.com/smartHomeHub/SmartIR/commit/1ed8ef23a8f7b9dcae75721eeab8d5f79013b851.patch";
+      hash = "sha256-IhdnTDtUa7mS+Vw/+BqfqWIKK4hbshbVgJNjfKjgAvI=";
+    })
+  ];
+
   propagatedBuildInputs = [
     aiofiles
     broadlink
@@ -28,6 +40,8 @@ buildHomeAssistantComponent rec {
     cp -r codes $out/custom_components/smartir/
   '';
 
+  passthru.updateScript = nix-update-script { };
+
   meta = with lib; {
     changelog = "https://github.com/smartHomeHub/SmartIR/releases/tag/v${version}";
     description = "Integration for Home Assistant to control climate, TV and fan devices via IR/RF controllers (Broadlink, Xiaomi, MQTT, LOOKin, ESPHome)";