diff --git a/pkgs/by-name/mu/music-assistant/providers.nix b/pkgs/by-name/mu/music-assistant/providers.nix index 3fa13fe8b57c..0495e794b714 100644 --- a/pkgs/by-name/mu/music-assistant/providers.nix +++ b/pkgs/by-name/mu/music-assistant/providers.nix @@ -27,8 +27,9 @@ fully_kiosk = ps: with ps; [ python-fullykiosk ]; - hass = [ - ]; # missing hass-client + hass = ps: with ps; [ + hass-client + ]; hass_players = [ ]; jellyfin = ps: with ps; [ diff --git a/pkgs/development/python-modules/hass-client/default.nix b/pkgs/development/python-modules/hass-client/default.nix new file mode 100644 index 000000000000..29b1a94965c2 --- /dev/null +++ b/pkgs/development/python-modules/hass-client/default.nix @@ -0,0 +1,56 @@ +{ + aiodns, + aiohttp, + brotli, + buildPythonPackage, + faust-cchardet, + fetchFromGitHub, + lib, + orjson, + setuptools, +}: + +buildPythonPackage rec { + pname = "hass-client"; + version = "1.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "music-assistant"; + repo = "python-hass-client"; + rev = "refs/tags/${version}"; + hash = "sha256-FA3acaXLWcBMDsabLPxVk6EArSxcTAnmFeO1ixTXB1Q="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + aiohttp + ]; + + optional-dependencies = { + speedups = [ + aiodns + brotli + faust-cchardet + orjson + ]; + }; + + pythonImportsCheck = [ + "hass_client" + ]; + + # upstream has no tests + doCheck = false; + + meta = { + changelog = "https://github.com/music-assistant/python-hass-client/releases/tag/${version}"; + description = "Basic client for connecting to Home Assistant over websockets and REST"; + homepage = "https://github.com/music-assistant/python-hass-client"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 792c1de8f33a..a1567654feaf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5523,6 +5523,8 @@ self: super: with self; { hap-python = callPackage ../development/python-modules/hap-python { }; + hass-client = callPackage ../development/python-modules/hass-client { }; + hass-nabucasa = callPackage ../development/python-modules/hass-nabucasa { }; hass-splunk = callPackage ../development/python-modules/hass-splunk { };