diff --git a/pkgs/development/python-modules/viaggiatreno-ha/default.nix b/pkgs/development/python-modules/viaggiatreno-ha/default.nix new file mode 100644 index 000000000000..110a99362d0b --- /dev/null +++ b/pkgs/development/python-modules/viaggiatreno-ha/default.nix @@ -0,0 +1,44 @@ +{ + lib, + aiohttp, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + setuptools, +}: + +buildPythonPackage rec { + pname = "viaggiatreno-ha"; + version = "0.2.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "monga"; + repo = "viaggiatreno_ha"; + tag = "v${version}"; + hash = "sha256-XmZVguuZK4pnAqINBWJbyAa5VesrQS6wP1jNPdWqhiQ="; + }; + + build-system = [ setuptools ]; + + dependencies = [ aiohttp ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + preCheck = '' + cd tests + ''; + + # Tests use aiohttp's AioHTTPTestCase which starts a local TCP server + __darwinAllowLocalNetworking = true; + + pythonImportsCheck = [ "viaggiatreno_ha" ]; + + meta = { + changelog = "https://github.com/monga/viaggiatreno_ha/releases/tag/${src.tag}"; + description = "Viaggiatreno API wrapper to use with Home Assistant"; + homepage = "https://github.com/monga/viaggiatreno_ha"; + license = lib.licenses.gpl3Plus; + maintainers = [ lib.maintainers.jamiemagee ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index c4483e2e9dee..697e1c70c5f9 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -6639,7 +6639,8 @@ ]; "viaggiatreno" = ps: with ps; [ - ]; # missing inputs: viaggiatreno_ha + viaggiatreno-ha + ]; "vicare" = ps: with ps; [ pyvicare diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8d7cd9dc2e16..fb8f3cb576b9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -20456,6 +20456,8 @@ self: super: with self; { vharfbuzz = callPackage ../development/python-modules/vharfbuzz { }; + viaggiatreno-ha = callPackage ../development/python-modules/viaggiatreno-ha { }; + victron-vrm = callPackage ../development/python-modules/victron-vrm { }; videocr = callPackage ../development/python-modules/videocr { };