From d1f3d5520ecb3e2b44b4a859fae5285eaf03df79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 25 Jun 2021 19:49:20 +0200 Subject: [PATCH 1/3] python3Packages.vilfo-api-client: init at 0.3.3 --- .../vilfo-api-client/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/vilfo-api-client/default.nix diff --git a/pkgs/development/python-modules/vilfo-api-client/default.nix b/pkgs/development/python-modules/vilfo-api-client/default.nix new file mode 100644 index 000000000000..cdc01d93a856 --- /dev/null +++ b/pkgs/development/python-modules/vilfo-api-client/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools-scm +, getmac +, requests +, pytestCheckHook +, responses +}: + +buildPythonPackage rec { + pname = "vilfo-api-client"; + version = "0.3.3"; + + src = fetchFromGitHub { + owner = "ManneW"; + repo = "vilfo-api-client-python"; + rev = "v${version}"; + sha256 = "1gy5gpsg99rcm1cc3m30232za00r9i46sp74zpd12p3vzz1wyyqf"; + }; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "get-mac" "getmac" + ''; + + nativeBuildInputs = [ + setuptools-scm + ]; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + propagatedBuildInputs = [ + getmac + requests + ]; + + checkInputs = [ + pytestCheckHook + responses + ]; + + pythonImportsCheck = [ "vilfo" ]; + + meta = with lib; { + description = "Simple wrapper client for the Vilfo router API"; + homepage = "https://github.com/ManneW/vilfo-api-client-python"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8a12c1556ab1..e2bf9d2a9e10 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8933,6 +8933,8 @@ in { viewstate = callPackage ../development/python-modules/viewstate { }; + vilfo-api-client = callPackage ../development/python-modules/vilfo-api-client { }; + vincenty = callPackage ../development/python-modules/vincenty { }; vine = callPackage ../development/python-modules/vine { }; From 043d7c485b284ea466ced394573ecd4c7e795748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 25 Jun 2021 19:50:11 +0200 Subject: [PATCH 2/3] home-assistant: update component-packages.nix --- 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 c17cb8d1714d..a2a6a629df27 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -927,7 +927,7 @@ "vesync" = ps: with ps; [ pyvesync ]; "viaggiatreno" = ps: with ps; [ ]; "vicare" = ps: with ps; [ pyvicare ]; - "vilfo" = ps: with ps; [ ]; # missing inputs: vilfo-api-client + "vilfo" = ps: with ps; [ vilfo-api-client ]; "vivotek" = ps: with ps; [ ]; # missing inputs: libpyvivotek "vizio" = ps: with ps; [ pyvizio ]; "vlc" = ps: with ps; [ python-vlc ]; From 5451bd7d9231c9493bb8e0df79ccafbe458aa64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 25 Jun 2021 19:52:04 +0200 Subject: [PATCH 3/3] home-assistant: test vilfo component --- 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 e00b355f0c32..dd6adf8c0544 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -707,6 +707,7 @@ in with py.pkgs; buildPythonApplication rec { "verisure" "version" "vesync" + "vilfo" "vizio" "voicerss" "volumio"