From dfcfc9151532458a14c32245e520e72229a4f635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 23 Jun 2021 16:53:23 +0200 Subject: [PATCH 1/3] python3Packages.huawei-lte-api: init at 1.4.18 --- .../python-modules/huawei-lte-api/default.nix | 51 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/python-modules/huawei-lte-api/default.nix diff --git a/pkgs/development/python-modules/huawei-lte-api/default.nix b/pkgs/development/python-modules/huawei-lte-api/default.nix new file mode 100644 index 000000000000..44cbfd4f0e0a --- /dev/null +++ b/pkgs/development/python-modules/huawei-lte-api/default.nix @@ -0,0 +1,51 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, dicttoxml +, requests +, xmltodict +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "huawei-lte-api"; + version = "1.4.18"; + + disabled = pythonOlder "3.4"; + + src = fetchFromGitHub { + owner = "Salamek"; + repo = "huawei-lte-api"; + rev = version; + sha256 = "1qaqxmh03j10wa9wqbwgc5r3ays8wfr7bldvsm45fycr3qfyn5fg"; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace "pytest-runner" "" + ''; + + propagatedBuildInputs = [ + dicttoxml + requests + xmltodict + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "huawei_lte_api.AuthorizedConnection" + "huawei_lte_api.Client" + "huawei_lte_api.Connection" + ]; + + meta = with lib; { + description = "API For huawei LAN/WAN LTE Modems"; + homepage = "https://github.com/Salamek/huawei-lte-api"; + license = licenses.lgpl3Only; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index af320bed9da5..cc76994aeee3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3324,6 +3324,8 @@ in { httpx = callPackage ../development/python-modules/httpx { }; + huawei-lte-api = callPackage ../development/python-modules/huawei-lte-api { }; + huey = callPackage ../development/python-modules/huey { }; hug = callPackage ../development/python-modules/hug { }; From 2958903932a3a7f923be59d4e84f80356242d687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 23 Jun 2021 16:53:38 +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 143554913bab..f4190ee7520b 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -368,7 +368,7 @@ "html5" = ps: with ps; [ aiohttp-cors pywebpush ]; "http" = ps: with ps; [ aiohttp-cors ]; "htu21d" = ps: with ps; [ smbus-cffi ]; # missing inputs: i2csense - "huawei_lte" = ps: with ps; [ getmac stringcase url-normalize ]; # missing inputs: huawei-lte-api + "huawei_lte" = ps: with ps; [ getmac huawei-lte-api stringcase url-normalize ]; "huawei_router" = ps: with ps; [ ]; "hue" = ps: with ps; [ aiohue ]; "huisbaasje" = ps: with ps; [ ]; # missing inputs: huisbaasje-client From 20560b05d87b41d0097dbaa14d7722b351fd8eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 23 Jun 2021 16:55:05 +0200 Subject: [PATCH 3/3] home-assistant: test huawei_lte 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 5bf5a5d9eb96..149aa79b7f82 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -454,6 +454,7 @@ in with py.pkgs; buildPythonApplication rec { "homematicip_cloud" "html5" "http" + "huawei_lte" "hue" "humidifier" "hyperion"