Files
nix-config/modules/nixos/homeassistant/hacs/wyzeapi.nix
2025-07-16 19:57:33 -05:00

60 lines
1.4 KiB
Nix

{ pkgs, ... }:
let
wyzeapy = pkgs.python3Packages.buildPythonPackage rec {
pname = "wyzeapy";
version = "0.5.27";
format = "pyproject";
src = pkgs.fetchFromGitHub {
owner = "SecKatie";
repo = "wyzeapy";
rev = version;
sha256 = "sha256-IfhRsVWj/bcKOtpCdmpgrz3L8iY73e+weHlOo5rfKHw=";
};
buildInputs = with pkgs.python3Packages; [ poetry-core ];
nativeBuildInputs = with pkgs.python3Packages; [
aiodns
aiohttp
pycryptodome
];
doCheck = false; # no tests in the PyPI tarball
};
ha-wyzeapi = pkgs.buildHomeAssistantComponent rec {
owner = "SecKatie";
domain = "wyzeapi";
version = "0.1.33";
src = pkgs.fetchFromGitHub {
owner = owner;
repo = "ha-wyzeapi";
rev = version;
hash = "sha256-Hl1Vmi2lhoJW3bdkrtO2mNqfLxURPwqFPjYgdrHRxYk=";
};
propagatedBuildInputs = [
wyzeapy
];
postPatch = ''
substituteInPlace custom_components/wyzeapi/manifest.json \
--replace '"wyzeapy>=0.5.28,<0.6"' '"wyzeapy>=0.5.27,<0.6"'
'';
meta = {
changelog = "https://github.com/SecKatie/ha-wyzeapi/releases/tag/${version}";
description = "This is a custom component to allow control of various Wyze devices in Home Assistant using the unofficial API.";
homepage = "https://github.com/SecKatie/ha-wyzeapi";
maintainers = [ ];
};
};
in
{
services.home-assistant.customComponents = [
ha-wyzeapi
];
}