From f71e493dea00c9fc9f585f1cc4ffdbf8c3862876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 29 Jun 2021 14:01:05 +0200 Subject: [PATCH 1/3] python3Packages.smart-meter-texas: init at 0.4.3 --- .../smart-meter-texas/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/smart-meter-texas/default.nix diff --git a/pkgs/development/python-modules/smart-meter-texas/default.nix b/pkgs/development/python-modules/smart-meter-texas/default.nix new file mode 100644 index 000000000000..abdcd7317bc5 --- /dev/null +++ b/pkgs/development/python-modules/smart-meter-texas/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, aiohttp +, python-dateutil +, tenacity +}: + +buildPythonPackage rec { + pname = "smart-meter-texas"; + version = "0.4.3"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "grahamwetzler"; + repo = "smart-meter-texas"; + rev = "v${version}"; + sha256 = "09n03wbyjh1b1gsiibf17fg86x7k1i1r1kpp94p7w1lcdbmn8v5c"; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest-runner" "" + ''; + + propagatedBuildInputs = [ + aiohttp + python-dateutil + tenacity + ]; + + # no tests implemented + doCheck = false; + + meta = with lib; { + description = "Connect to and retrieve data from the unofficial Smart Meter Texas API"; + homepage = "https://github.com/grahamwetzler/smart-meter-texas"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index efe5f4268780..ef6b5270294c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7984,6 +7984,8 @@ in { sly = callPackage ../development/python-modules/sly { }; + smart-meter-texas = callPackage ../development/python-modules/smart-meter-texas { }; + smart-open = callPackage ../development/python-modules/smart-open { }; smarthab = callPackage ../development/python-modules/smarthab { }; From 6d682ef306c48a3949688a2f9702d21e894a015f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 29 Jun 2021 14:01:21 +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 aa7ea6cd449a..605c2afefbcd 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -767,7 +767,7 @@ "slide" = ps: with ps; [ ]; # missing inputs: goslide-api "sma" = ps: with ps; [ pysma ]; "smappee" = ps: with ps; [ aiohttp-cors pysmappee ]; - "smart_meter_texas" = ps: with ps; [ ]; # missing inputs: smart-meter-texas + "smart_meter_texas" = ps: with ps; [ smart-meter-texas ]; "smarthab" = ps: with ps; [ smarthab ]; "smartthings" = ps: with ps; [ aiohttp-cors hass-nabucasa pysmartapp pysmartthings ]; "smarttub" = ps: with ps; [ python-smarttub ]; From 2e25f443c9ec15b9f034612709f188777411a884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 29 Jun 2021 14:03:00 +0200 Subject: [PATCH 3/3] home-assistant: test smart_meter_texas 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 1159cbbd57d8..d945dbee5b58 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -657,6 +657,7 @@ in with py.pkgs; buildPythonApplication rec { "sleepiq" "sma" "smappee" + "smart_meter_texas" "smarthab" "smartthings" "smarttub"