51 lines
1.2 KiB
Nix
51 lines
1.2 KiB
Nix
{ fetchFromGitHub, python3Packages, buildHomeAssistantComponent }:
|
|
let
|
|
manifest = builtins.toJSON {
|
|
domain = "color_recognizer";
|
|
name = "Spotify color recognizer";
|
|
version = "6e99269";
|
|
iot_class = "local_polling";
|
|
};
|
|
in
|
|
buildHomeAssistantComponent {
|
|
owner = "zewelor";
|
|
domain = "color_recognizer";
|
|
version = "6e99269";
|
|
|
|
dependencies = [
|
|
python3Packages.numpy
|
|
python3Packages.scipy
|
|
python3Packages.voluptuous
|
|
python3Packages.pillow
|
|
];
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "zewelor";
|
|
repo = "ha_custom_components";
|
|
rev = "6e99269";
|
|
sha256 = "sha256-0Qgtt5gMOUZQphUkI6uYiZ/A8xsXP1eMrVlC+EmjXj8=";
|
|
};
|
|
|
|
prePatch = ''
|
|
mkdir custom_components
|
|
cp -a color_recognizer/ custom_components/
|
|
echo '${manifest}' > custom_components/color_recognizer/manifest.json
|
|
'';
|
|
|
|
# propagatedBuildInputs = [
|
|
# python3Packages.numpy
|
|
# python3Packages.scipy
|
|
# python3Packages.voluptuous
|
|
# python3Packages.pillow
|
|
# ];
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "PIL" "numpy" "scipy" "voluptuous" ];
|
|
|
|
meta = {
|
|
description = "Analyzes an image and finds a fitting background color";
|
|
homepage = "https://github.com/zewelor/ha_custom_components";
|
|
};
|
|
|
|
}
|