From 89168356c268a0ce20ab627e5445d59aa1950c3d Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 22 Apr 2021 21:53:09 +0200 Subject: [PATCH 1/3] python3Packages.openerz-api: init at 0.1.0 --- .../python-modules/openerz-api/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/openerz-api/default.nix diff --git a/pkgs/development/python-modules/openerz-api/default.nix b/pkgs/development/python-modules/openerz-api/default.nix new file mode 100644 index 000000000000..9cbe89e26a34 --- /dev/null +++ b/pkgs/development/python-modules/openerz-api/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, requests +, testfixtures +}: + +buildPythonPackage rec { + pname = "openerz-api"; + version = "0.1.0"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "misialq"; + repo = pname; + rev = "v${version}"; + sha256 = "10kxsmaz2rn26jijaxmdmhx8vjdz8hrhlrvd39gc8yvqbjwhi3nw"; + }; + + propagatedBuildInputs = [ + requests + ]; + + checkInputs = [ + pytestCheckHook + testfixtures + ]; + + pythonImportsCheck = [ "openerz_api" ]; + + meta = with lib; { + description = "Python module to interact with the OpenERZ API"; + homepage = "https://github.com/misialq/openerz-api"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7488dfd8fd36..8169495a3e16 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4906,6 +4906,8 @@ in { pythonPackages = self; })); + openerz-api = callPackage ../development/python-modules/openerz-api { }; + openhomedevice = callPackage ../development/python-modules/openhomedevice { }; openidc-client = callPackage ../development/python-modules/openidc-client { }; From 907d65bde41164f697283d89912eb37db9a3e9ac Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 22 Apr 2021 21:53:56 +0200 Subject: [PATCH 2/3] 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 65d304fb90be..8a00c8b5f767 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -590,7 +590,7 @@ "openalpr_cloud" = ps: with ps; [ ]; "openalpr_local" = ps: with ps; [ ]; "opencv" = ps: with ps; [ numpy ]; # missing inputs: opencv-python-headless - "openerz" = ps: with ps; [ ]; # missing inputs: openerz-api + "openerz" = ps: with ps; [ openerz-api ]; "openevse" = ps: with ps; [ ]; # missing inputs: openevsewifi "openexchangerates" = ps: with ps; [ ]; "opengarage" = ps: with ps; [ ]; # missing inputs: open-garage From 40d82c7abc00bce5fde9aba3a5c8d45461da8d76 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 22 Apr 2021 21:55:05 +0200 Subject: [PATCH 3/3] home-assistant: enable openerz 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 1ebc381c6cc2..d4516167fddd 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -324,6 +324,7 @@ in with py.pkgs; buildPythonApplication rec { "number" "omnilogic" "ondilo_ico" + "openerz" "ozw" "panel_custom" "panel_iframe"