diff --git a/pkgs/development/python-modules/aiokef/default.nix b/pkgs/development/python-modules/aiokef/default.nix new file mode 100644 index 000000000000..c153ff37d8c2 --- /dev/null +++ b/pkgs/development/python-modules/aiokef/default.nix @@ -0,0 +1,44 @@ +{ lib +, async-timeout +, buildPythonPackage +, fetchFromGitHub +, pytest-cov +, pytestCheckHook +, pytest-mypy +, pythonOlder +, tenacity +}: + +buildPythonPackage rec { + pname = "aiokef"; + version = "0.2.17"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "basnijholt"; + repo = pname; + rev = "v${version}"; + sha256 = "0ms0dwrpj80w55svcppbnp7vyl5ipnjfp1c436k5c7pph4q5pxk9"; + }; + + propagatedBuildInputs = [ + async-timeout + tenacity + ]; + + checkInputs = [ + pytest-cov + pytest-mypy + pytestCheckHook + ]; + + pytestFlagsArray = [ "tests" ]; + pythonImportsCheck = [ "aiokef" ]; + + meta = with lib; { + description = "Python API for KEF speakers"; + homepage = "https://github.com/basnijholt/aiokef"; + license = with 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 c75d32b7f762..acb62d0c22fc 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -413,7 +413,7 @@ "kankun" = ps: with ps; [ ]; "keba" = ps: with ps; [ ]; # missing inputs: keba-kecontact "keenetic_ndms2" = ps: with ps; [ ]; # missing inputs: ndms2_client - "kef" = ps: with ps; [ getmac ]; # missing inputs: aiokef + "kef" = ps: with ps; [ aiokef getmac ]; "keyboard" = ps: with ps; [ ]; # missing inputs: pyuserinput "keyboard_remote" = ps: with ps; [ aionotify evdev ]; "kira" = ps: with ps; [ ]; # missing inputs: pykira diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2c2655166362..26e48f288673 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -242,6 +242,8 @@ in { aiokafka = callPackage ../development/python-modules/aiokafka { }; + aiokef = callPackage ../development/python-modules/aiokef { }; + aiolifx = callPackage ../development/python-modules/aiolifx { }; aiolifx-effects = callPackage ../development/python-modules/aiolifx-effects { };