Skip to content

Commit

Permalink
home-assistant-custom-components.smartir: replace disutils with `pa…
Browse files Browse the repository at this point in the history
…ckaging`

- Format using nixfmt-rfc-style
- Add passthru.updateScript
  • Loading branch information
azuwis committed May 13, 2024
1 parent 5e1830b commit 36d6686
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions pkgs/servers/home-assistant/custom-components/smartir/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{ lib
, buildHomeAssistantComponent
, fetchFromGitHub
, aiofiles
, broadlink
{
lib,
buildHomeAssistantComponent,
fetchFromGitHub,
fetchpatch,
aiofiles,
broadlink,
nix-update-script,
}:

buildHomeAssistantComponent rec {
Expand All @@ -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
Expand All @@ -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)";
Expand Down

0 comments on commit 36d6686

Please sign in to comment.