From d6e317980da38884b72581d9034132641fd5d1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 15 Jun 2021 00:27:19 +0200 Subject: [PATCH 1/3] python3Packages.wallbox: init at 0.4.5 --- .../python-modules/wallbox/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/wallbox/default.nix diff --git a/pkgs/development/python-modules/wallbox/default.nix b/pkgs/development/python-modules/wallbox/default.nix new file mode 100644 index 000000000000..c892ea3f88cd --- /dev/null +++ b/pkgs/development/python-modules/wallbox/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchPypi +, requests +, simplejson +}: + +buildPythonPackage rec { + pname = "wallbox"; + version = "0.4.5"; + + disabled = pythonOlder "3.7"; + + src = fetchPypi { + inherit pname version; + sha256 = "cf1616d79cb0345849ceff1b89a7c80e26ae19b3c2d818def62d6975665838c1"; + }; + + propagatedBuildInputs = [ + requests + simplejson + ]; + + # no tests implemented + doCheck = false; + + pythonImportsCheck = [ "wallbox" ]; + + meta = with lib; { + description = "Module for interacting with Wallbox EV charger api"; + homepage = "https://github.com/cliviu74/wallbox"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a84a3adfb507..798f653ed834 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8863,6 +8863,8 @@ in { wakeonlan = callPackage ../development/python-modules/wakeonlan { }; + wallbox = callPackage ../development/python-modules/wallbox { }; + Wand = callPackage ../development/python-modules/Wand { }; warlock = callPackage ../development/python-modules/warlock { }; From d96bb54ca17ebf83128f2af7a6cfd66cfbb4a50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 15 Jun 2021 00:27:45 +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 e62d3dbcf4b0..4241b0902015 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -939,7 +939,7 @@ "vultr" = ps: with ps; [ vultr ]; "w800rf32" = ps: with ps; [ ]; # missing inputs: pyW800rf32 "wake_on_lan" = ps: with ps; [ wakeonlan ]; - "wallbox" = ps: with ps; [ ]; # missing inputs: wallbox + "wallbox" = ps: with ps; [ wallbox ]; "waqi" = ps: with ps; [ waqiasync ]; "water_heater" = ps: with ps; [ ]; "waterfurnace" = ps: with ps; [ waterfurnace ]; From ac0e2f63d0237b653fc0f07a6868acfc8716c8e0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 14:13:02 +0200 Subject: [PATCH 3/3] home-assistant: enable wallbox tests Disable two tests that try to access the network. --- pkgs/servers/home-assistant/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 551ab4dedf64..2e66096aec5f 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -663,6 +663,7 @@ in with py.pkgs; buildPythonApplication rec { "volumio" "vultr" "wake_on_lan" + "wallbox" "water_heater" "waze_travel_time" "weather" @@ -727,6 +728,9 @@ in with py.pkgs; buildPythonApplication rec { "--deselect tests/components/prometheus/test_init.py::test_view" # smhi/test_init.py: Tries to fetch data from the network: socket.gaierror: [Errno -2] Name or service not known "--deselect tests/components/smhi/test_init.py::test_remove_entry" + # wallbox/test_config_flow.py: Tries to connect to api.wall-box.cim: Failed to establish a new connection: [Errno -2] Name or service not known + "--deselect tests/components/wallbox/test_config_flow.py::test_form_invalid_auth" + "--deselect tests/components/wallbox/test_config_flow.py::test_form_cannot_connect" # tests are located in tests/ "tests" # dynamically add packages required for component tests