diff --git a/pkgs/development/python-modules/iaqualink/default.nix b/pkgs/development/python-modules/iaqualink/default.nix new file mode 100644 index 000000000000..223f3893e18d --- /dev/null +++ b/pkgs/development/python-modules/iaqualink/default.nix @@ -0,0 +1,36 @@ +{ lib +, aiohttp +, buildPythonPackage +, fetchFromGitHub +, pytest-runner +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "iaqualink"; + version = "0.4.0"; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "flz"; + repo = "iaqualink-py"; + rev = "v${version}"; + sha256 = "13iwngjjqzr1pkmskbc2wakccvcjkf4bk65f4jp4ywpciilr4zjw"; + }; + + nativeBuildInputs = [ pytest-runner ]; + + propagatedBuildInputs = [ aiohttp ]; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "iaqualink" ]; + + meta = with lib; { + description = "Python library for Jandy iAqualink"; + homepage = "https://github.com/flz/iaqualink-py"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 45ae821a9b82..80fc6fbc3334 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -374,7 +374,7 @@ "hydrawise" = ps: with ps; [ hydrawiser ]; "hyperion" = ps: with ps; [ ]; # missing inputs: hyperion-py "iammeter" = ps: with ps; [ ]; # missing inputs: iammeter - "iaqualink" = ps: with ps; [ ]; # missing inputs: iaqualink + "iaqualink" = ps: with ps; [ iaqualink ]; "icloud" = ps: with ps; [ pyicloud ]; "idteck_prox" = ps: with ps; [ ]; # missing inputs: rfk101py "ifttt" = ps: with ps; [ aiohttp-cors pyfttt ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 82bb54dd889c..b2c1c1c8aab9 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -28,6 +28,21 @@ let (mkOverride "astral" "1.10.1" "d2a67243c4503131c856cafb1b1276de52a86e5b8a1d507b7e08bee51cb67bf1") + # Pinned due to API changes in iaqualink>=2.0, remove after + # https://github.com/home-assistant/core/pull/48137 was merged + (self: super: { + iaqualink = super.iaqualink.overridePythonAttrs (oldAttrs: rec { + version = "0.3.4"; + src = fetchFromGitHub { + owner = "flz"; + repo = "iaqualink-py"; + rev = version; + sha256 = "16mn6nd9x3hm6j6da99qhwbqs95hh8wx21r1h1m9csl76z77n9lh"; + }; + checkInputs = oldAttrs.checkInputs ++ [ python3.pkgs.asynctest ]; + }); + }) + # Pinned due to bug in ring-doorbell 0.7.0 # https://github.com/tchellomello/python-ring-doorbell/issues/240 (mkOverride "ring-doorbell" "0.6.2" @@ -213,6 +228,7 @@ in with py.pkgs; buildPythonApplication rec { "html5" "http" "hue" + "iaqualink" "ifttt" "image" "image_processing" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cedd38463393..d1383da95742 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3206,6 +3206,8 @@ in { iapws = callPackage ../development/python-modules/iapws { }; + iaqualink = callPackage ../development/python-modules/iaqualink { }; + ibis = callPackage ../development/python-modules/ibis { }; ibis-framework = callPackage ../development/python-modules/ibis-framework { };