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/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index c7aa936c3233..e76fe501a523 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 ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 819b1cf808fa..c2eae3756588 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -669,6 +669,7 @@ in with py.pkgs; buildPythonApplication rec { "volumio" "vultr" "wake_on_lan" + "wallbox" "water_heater" "waze_travel_time" "weather" @@ -734,6 +735,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 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0ccb14530a0c..9f931142edb1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8888,6 +8888,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 { };