From 3978e1f7b149f0416e49efe1e546eda172ff2ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Tue, 1 Oct 2024 19:47:59 +0200 Subject: [PATCH] python3Packages.amshan: init at 2.1.1 https://github.com/toreamun/amshan --- .../python-modules/amshan/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 52 insertions(+) create mode 100644 pkgs/development/python-modules/amshan/default.nix diff --git a/pkgs/development/python-modules/amshan/default.nix b/pkgs/development/python-modules/amshan/default.nix new file mode 100644 index 000000000000..82eaa056d876 --- /dev/null +++ b/pkgs/development/python-modules/amshan/default.nix @@ -0,0 +1,50 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + construct, + paho-mqtt, + pyserial-asyncio, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "amshan"; + version = "2.1.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "toreamun"; + repo = "amshan"; + rev = version; + hash = "sha256-aw0wTqb2s84STVUN55h6L926pXwaMSppBCfXZVb87w0="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + construct + paho-mqtt + pyserial-asyncio + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "han" ]; + + meta = { + description = "Decode smart power meter data stream of Cosem HDLC frames used by MBUS"; + longDescription = '' + The package has special support of formats for Aidon, Kaifa and Kamstrup + meters used in Norway and Sweden (AMS HAN). + ''; + homepage = "https://github.com/toreamun/amshan"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ bjornfor ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 851b3f9c7d5b..b99f8d5a12d1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -588,6 +588,8 @@ self: super: with self; { amqtt = callPackage ../development/python-modules/amqtt { }; + amshan = callPackage ../development/python-modules/amshan { }; + anchor-kr = callPackage ../development/python-modules/anchor-kr { }; ancp-bids = callPackage ../development/python-modules/ancp-bids { };