diff --git a/pkgs/development/python-modules/ha-philipsjs/default.nix b/pkgs/development/python-modules/ha-philipsjs/default.nix new file mode 100644 index 000000000000..c6de997a1da7 --- /dev/null +++ b/pkgs/development/python-modules/ha-philipsjs/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, cryptography +, fetchFromGitHub +, httpx +, pytest-aiohttp +, pytest-mock +, pytestCheckHook +, pythonOlder +, respx +}: + +buildPythonPackage rec { + pname = "ha-philipsjs"; + version = "2.7.4"; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "danielperna84"; + repo = pname; + rev = version; + sha256 = "08fjdb1q02dwxq8s15ddd00gps64xplblkn8dx5yivldskiy8i1n"; + }; + + propagatedBuildInputs = [ + cryptography + httpx + ]; + + checkInputs = [ + pytest-aiohttp + pytest-mock + pytestCheckHook + respx + ]; + + pythonImportsCheck = [ "haphilipsjs" ]; + + meta = with lib; { + description = "Python library to interact with Philips TVs with jointSPACE API"; + homepage = "https://github.com/danielperna84/ha-philipsjs"; + 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 d648e439f29e..a45981227776 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -626,7 +626,7 @@ "pencom" = ps: with ps; [ ]; # missing inputs: pencompy "persistent_notification" = ps: with ps; [ ]; "person" = ps: with ps; [ aiohttp-cors pillow ]; - "philips_js" = ps: with ps; [ ]; # missing inputs: ha-philipsjs + "philips_js" = ps: with ps; [ ha-philipsjs ]; "pi4ioe5v9xxxx" = ps: with ps; [ ]; # missing inputs: pi4ioe5v9xxxx "pi_hole" = ps: with ps; [ hole ]; "picnic" = ps: with ps; [ python-picnic-api ]; diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 5a8b3633d548..52b049e4576f 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -336,6 +336,7 @@ in with py.pkgs; buildPythonApplication rec { "panel_iframe" "persistent_notification" "person" + "philips_js" "plaato" "plugwise" "prometheus" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 99790a1efcf5..f95ecddbe1ad 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3021,6 +3021,8 @@ in { ha-ffmpeg = callPackage ../development/python-modules/ha-ffmpeg { }; + ha-philipsjs = callPackage ../development/python-modules/ha-philipsjs{ }; + halo = callPackage ../development/python-modules/halo { }; handout = callPackage ../development/python-modules/handout { };