diff --git a/pkgs/development/python-modules/airgradient/default.nix b/pkgs/development/python-modules/airgradient/default.nix new file mode 100644 index 000000000000..bfffb0e3e9e0 --- /dev/null +++ b/pkgs/development/python-modules/airgradient/default.nix @@ -0,0 +1,61 @@ +{ + lib, + aiohttp, + aioresponses, + buildPythonPackage, + fetchFromGitHub, + mashumaro, + orjson, + poetry-core, + pytest-asyncio, + pytestCheckHook, + pythonOlder, + syrupy, + yarl, +}: + +buildPythonPackage rec { + pname = "airgradient"; + version = "0.6.1"; + pyproject = true; + + disabled = pythonOlder "3.11"; + + src = fetchFromGitHub { + owner = "airgradienthq"; + repo = "python-airgradient"; + rev = "refs/tags/v${version}"; + hash = "sha256-1f5sFpuQgmmAFKdunpuuDuKm9CK1K8iXBV/q2qJoe/o="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "--cov" "" + ''; + + build-system = [ poetry-core ]; + + dependencies = [ + aiohttp + mashumaro + orjson + yarl + ]; + + nativeCheckInputs = [ + aioresponses + pytest-asyncio + pytestCheckHook + syrupy + ]; + + pythonImportsCheck = [ "airgradient" ]; + + meta = with lib; { + description = "Module for AirGradient"; + homepage = "https://github.com/airgradienthq/python-airgradient"; + changelog = "https://github.com/airgradienthq/python-airgradient/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index bb091fc0d0cb..cd4464b2f58f 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -51,7 +51,8 @@ "air_quality" = ps: with ps; [ ]; "airgradient" = ps: with ps; [ - ]; # missing inputs: airgradient + airgradient + ]; "airly" = ps: with ps; [ airly ]; @@ -5230,6 +5231,7 @@ "aftership" "agent_dvr" "air_quality" + "airgradient" "airly" "airnow" "airq" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ce5d234e24ff..72c3520a52d7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -465,6 +465,8 @@ self: super: with self; { aiozoneinfo = callPackage ../development/python-modules/aiozoneinfo { }; + airgradient = callPackage ../development/python-modules/airgradient { }; + airium = callPackage ../development/python-modules/airium { }; airly = callPackage ../development/python-modules/airly { };