diff --git a/pkgs/development/python-modules/py-unifi-access/default.nix b/pkgs/development/python-modules/py-unifi-access/default.nix new file mode 100644 index 000000000000..c06334edd5b0 --- /dev/null +++ b/pkgs/development/python-modules/py-unifi-access/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + aiohttp, + pydantic, + aioresponses, + pytest-asyncio, + pytest-cov-stub, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "py-unifi-access"; + version = "1.1.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "imhotep"; + repo = "py-unifi-access"; + tag = finalAttrs.version; + hash = "sha256-FYhHTYQl+yGHcAu0APqdfca/YSMp3GSQmY7kSO4xkH8="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + aiohttp + pydantic + ]; + + nativeCheckInputs = [ + aioresponses + pytest-asyncio + pytest-cov-stub + pytestCheckHook + ]; + + pythonImportsCheck = [ "unifi_access_api" ]; + + meta = { + description = "Async Python client for the UniFi Access local API with WebSocket event support"; + homepage = "https://github.com/imhotep/py-unifi-access"; + changelog = "https://github.com/imhotep/py-unifi-access/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.jamiemagee ]; + }; +}) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index c577a5688ff7..0e7e178beb2d 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -6697,7 +6697,8 @@ ]; "unifi_access" = ps: with ps; [ - ]; # missing inputs: py-unifi-access + py-unifi-access + ]; "unifi_direct" = ps: with ps; [ unifi-ap @@ -8344,6 +8345,7 @@ "uk_transport" "ukraine_alarm" "unifi" + "unifi_access" "unifiprotect" "universal" "upb" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9a0a079a9b33..ddbf8c8b9501 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13185,6 +13185,8 @@ self: super: with self; { py-ubjson = callPackage ../development/python-modules/py-ubjson { }; + py-unifi-access = callPackage ../development/python-modules/py-unifi-access { }; + py-vapid = callPackage ../development/python-modules/py-vapid { }; py-zabbix = callPackage ../development/python-modules/py-zabbix { };