From 561fa02f123fe83cccc8bc5c311df10e6988d982 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 20 Mar 2021 09:53:47 +0100 Subject: [PATCH 1/4] python3Packages.iaqualink: init at 0.4.0 --- .../python-modules/iaqualink/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/iaqualink/default.nix diff --git a/pkgs/development/python-modules/iaqualink/default.nix b/pkgs/development/python-modules/iaqualink/default.nix new file mode 100644 index 00000000000000..223f3893e18d27 --- /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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 95d942a64f171b..a1d8dc8e890a3c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3184,6 +3184,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 { }; From 3906bb02d8f0e0334570db8a9ba5b94d14edfcd8 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 20 Mar 2021 09:55:31 +0100 Subject: [PATCH 2/4] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 98fba35b9f11e7..7930ea319b188f 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 ]; From 46fe40324a39f950b7e25dfb2259cb287fe2a87f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 21 Mar 2021 01:08:49 +0100 Subject: [PATCH 3/4] home-assistant: enable iaqualink tests --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index dc61317876b034..4646cbdc92e9c4 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -213,6 +213,7 @@ in with py.pkgs; buildPythonApplication rec { "html5" "http" "hue" + "iaqualink" "ifttt" "image" "image_processing" From cfce5158023892d30a18d57ba006fba05aa73055 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 21 Mar 2021 04:14:48 +0100 Subject: [PATCH 4/4] home-assistant: pin iaqualink at 0.3.4 This was required due to breaking API changes in iaqualink>=0.4.0 and can be safely removed after https://github.com/home-assistant/core/pull/48137 has been merged and released. --- pkgs/servers/home-assistant/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 4646cbdc92e9c4..d5b8d20d282fa0 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"