home-assistant-custom-components.smartir: replace disutils with packaging

- Format using nixfmt-rfc-style
- Add passthru.updateScript
This commit is contained in:
Zhong Jianxin 2024-05-13 21:50:43 +08:00
parent 5e1830b877
commit 36d6686f0d

View File

@ -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)";