diff --git a/pkgs/development/python-modules/pyteleinfo/default.nix b/pkgs/development/python-modules/pyteleinfo/default.nix new file mode 100644 index 000000000000..15f3a227417d --- /dev/null +++ b/pkgs/development/python-modules/pyteleinfo/default.nix @@ -0,0 +1,55 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + pydantic-settings, + pyserial, + pyserial-asyncio-fast, + pyhamcrest, + pytest-asyncio, + pytest-cov-stub, + pytest-mock, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "pyteleinfo"; + version = "0.4.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "esciara"; + repo = "pyteleinfo"; + tag = "v${finalAttrs.version}"; + hash = "sha256-uNkCunWlFoGmg80t69z2PXyPL1pGDsezTc8heec97VI="; + }; + + build-system = [ hatchling ]; + + pythonRelaxDeps = [ "pydantic-settings" ]; + + dependencies = [ + pydantic-settings + pyserial + pyserial-asyncio-fast + ]; + + nativeCheckInputs = [ + pyhamcrest + pytest-asyncio + pytest-cov-stub + pytest-mock + pytestCheckHook + ]; + + pythonImportsCheck = [ "teleinfo" ]; + + meta = { + description = "Python library for decoding and encoding ENEDIS teleinfo frames"; + homepage = "https://github.com/esciara/pyteleinfo"; + changelog = "https://github.com/esciara/pyteleinfo/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.jamiemagee ]; + }; +}) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 1d6ef8b616ab..04af0a467488 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -6346,8 +6346,9 @@ "teleinfo" = ps: with ps; [ aiousbwatcher + pyteleinfo serialx - ]; # missing inputs: pyteleinfo + ]; "tellduslive" = ps: with ps; [ tellduslive @@ -8376,6 +8377,7 @@ "tedee" "telegram" "telegram_bot" + "teleinfo" "tellduslive" "teltonika" "temper" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6764c6b7795e..f32ed99f5771 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15295,6 +15295,8 @@ self: super: with self; { pytelegrambotapi = callPackage ../development/python-modules/pyTelegramBotAPI { }; + pyteleinfo = callPackage ../development/python-modules/pyteleinfo { }; + pytenable = callPackage ../development/python-modules/pytenable { }; pytensor = callPackage ../development/python-modules/pytensor { };