diff --git a/pkgs/development/python-modules/aiohomekit/default.nix b/pkgs/development/python-modules/aiohomekit/default.nix new file mode 100644 index 00000000000..5a51f66b16a --- /dev/null +++ b/pkgs/development/python-modules/aiohomekit/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, cryptography +, fetchFromGitHub +, poetry +, pytest-aiohttp +, pytestCheckHook +, pythonAtLeast +, zeroconf +}: + +buildPythonPackage rec { + pname = "aiohomekit"; + version = "0.2.60"; + format = "pyproject"; + disabled = pythonAtLeast "3.9"; + + src = fetchFromGitHub { + owner = "Jc2k"; + repo = pname; + rev = version; + sha256 = "03llk5i22hq163x568kz0qar5h0sda8f8cxbmgya6z2dcxv0a83p"; + }; + + nativeBuildInputs = [ poetry ]; + + propagatedBuildInputs = [ + cryptography + zeroconf + ]; + + checkInputs = [ + pytest-aiohttp + pytestCheckHook + ]; + + # Some test requires network access + disabledTests = [ + "test_remove_pairing" + "test_pair" + "test_add_and_remove_pairings" + ]; + + pythonImportsCheck = [ "aiohomekit" ]; + + meta = with lib; { + description = "Python module that implements the HomeKit protocol"; + longDescription = '' + This Python library implements the HomeKit protocol for controlling + Homekit accessories. + ''; + homepage = "https://github.com/Jc2k/aiohomekit"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 3506998e194..a3044b2de71 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -351,7 +351,7 @@ "home_connect" = ps: with ps; [ aiohttp-cors ]; # missing inputs: homeconnect "homeassistant" = ps: with ps; [ ]; "homekit" = ps: with ps; [ HAP-python pyqrcode aiohttp-cors base36 ha-ffmpeg zeroconf ]; # missing inputs: PyTurboJPEG fnvhash - "homekit_controller" = ps: with ps; [ aiohttp-cors zeroconf ]; # missing inputs: aiohomekit + "homekit_controller" = ps: with ps; [ aiohomekit aiohttp-cors zeroconf ]; "homematic" = ps: with ps; [ pyhomematic ]; "homematicip_cloud" = ps: with ps; [ ]; # missing inputs: homematicip "homeworks" = ps: with ps; [ ]; # missing inputs: pyhomeworks diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cd9dce6bbb3..abca7ee1c2d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -218,6 +218,8 @@ in { aioharmony = callPackage ../development/python-modules/aioharmony { }; + aiohomekit = callPackage ../development/python-modules/aiohomekit { }; + aiohttp = callPackage ../development/python-modules/aiohttp { }; aiohttp-cors = callPackage ../development/python-modules/aiohttp-cors { };