diff --git a/pkgs/development/python-modules/peblar/default.nix b/pkgs/development/python-modules/peblar/default.nix new file mode 100644 index 000000000000..c763b51bc68f --- /dev/null +++ b/pkgs/development/python-modules/peblar/default.nix @@ -0,0 +1,77 @@ +{ + lib, + aiohttp, + aresponses, + awesomeversion, + backoff, + buildPythonPackage, + fetchFromGitHub, + hatchling, + mashumaro, + orjson, + pytest-asyncio, + pytest-cov-stub, + pytestCheckHook, + pythonOlder, + syrupy, + typer, + yarl, + zeroconf, +}: + +buildPythonPackage rec { + pname = "peblar"; + version = "0.4.0"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "frenck"; + repo = "python-peblar"; + tag = "v${version}"; + hash = "sha256-cHb/VTaa7tkePqV7eLpDSxrnY8hAnjshwtwyWmJnt/4="; + }; + + postPatch = '' + # Upstream doesn't set a version for GitHub releases + substituteInPlace pyproject.toml \ + --replace-fail 'version = "0.0.0"' 'version = "${version}"' + ''; + + build-system = [ hatchling ]; + + dependencies = [ + aiohttp + awesomeversion + backoff + mashumaro + orjson + yarl + ]; + + optional-dependencies = { + cli = [ + typer + zeroconf + ]; + }; + + nativeCheckInputs = [ + aresponses + pytest-asyncio + pytest-cov-stub + pytestCheckHook + syrupy + ]; + + pythonImportsCheck = [ "peblar" ]; + + meta = { + description = "Python client for Peblar EV chargers"; + homepage = "https://github.com/frenck/python-peblar"; + changelog = "https://github.com/frenck/python-peblar/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index a7ea10d1420c..5e3b41d089cc 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -4214,7 +4214,8 @@ ]; "peblar" = ps: with ps; [ - ]; # missing inputs: peblar + peblar + ]; "peco" = ps: with ps; [ peco @@ -7144,6 +7145,7 @@ "palazzetti" "panasonic_viera" "panel_custom" + "peblar" "peco" "pegel_online" "permobil" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 755147a1865e..66624908340e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10362,6 +10362,8 @@ self: super: with self; { pebble = callPackage ../development/python-modules/pebble { }; + peblar = callPackage ../development/python-modules/peblar { }; + pecan = callPackage ../development/python-modules/pecan { }; peco = callPackage ../development/python-modules/peco { };