From 8e8f4be516894302d90aff2d233902012509ce0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 15 May 2022 02:02:12 +0000 Subject: [PATCH 1/2] python3Packages.tesla-powerwall: init at 0.3.17 --- .../tesla-powerwall/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/tesla-powerwall/default.nix diff --git a/pkgs/development/python-modules/tesla-powerwall/default.nix b/pkgs/development/python-modules/tesla-powerwall/default.nix new file mode 100644 index 000000000000..a2a7b4893745 --- /dev/null +++ b/pkgs/development/python-modules/tesla-powerwall/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchPypi +, requests +, pytestCheckHook +, responses +}: + +buildPythonPackage rec { + pname = "tesla-powerwall"; + version = "0.3.17"; + + format = "setuptools"; + + src = fetchPypi { + pname = "tesla_powerwall"; + inherit version; + sha256 = "09351e408e8e3cc03414944c1a487ef2178300829559e80835026acb84330cfd"; + }; + + propagatedBuildInputs = [ + requests + ]; + + checkInputs = [ + pytestCheckHook + responses + ]; + + pytestFlagsArray = [ + "tests/unit" + ]; + + pythonImportsCheck = [ "tesla_powerwall" ]; + + meta = { + description = "API for Tesla Powerwall"; + homepage = "https://github.com/jrester/tesla_powerwall"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 13d0c0beaca3..a1699fdec249 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10189,6 +10189,8 @@ in { tern = callPackage ../development/python-modules/tern { }; + tesla-powerwall = callPackage ../development/python-modules/tesla-powerwall { }; + tesla-wall-connector = callPackage ../development/python-modules/tesla-wall-connector { }; teslajsonpy = callPackage ../development/python-modules/teslajsonpy { }; From dc743d582e334844bd12165d0241ef6b2f9c6984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 15 May 2022 02:03:18 +0000 Subject: [PATCH 2/2] home-assistant: support powerwall component --- pkgs/servers/home-assistant/component-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index df5e7ed3b984..0bd0731d29f2 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2032,7 +2032,8 @@ poolsense ]; "powerwall" = ps: with ps; [ - ]; # missing inputs: tesla-powerwall + tesla-powerwall + ]; "profiler" = ps: with ps; [ guppy3 objgraph @@ -3557,6 +3558,7 @@ "plugwise" "point" "poolsense" + "powerwall" "profiler" "prometheus" "prosegur"