1{
2 aiodns,
3 aiohttp,
4 brotli,
5 buildPythonPackage,
6 faust-cchardet,
7 fetchFromGitHub,
8 lib,
9 orjson,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 pname = "hass-client";
15 version = "1.2.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "music-assistant";
20 repo = "python-hass-client";
21 tag = version;
22 hash = "sha256-FA3acaXLWcBMDsabLPxVk6EArSxcTAnmFeO1ixTXB1Q=";
23 };
24
25 postPatch = ''
26 substituteInPlace pyproject.toml \
27 --replace-fail "1.0.0" "${version}"
28 '';
29
30 build-system = [
31 setuptools
32 ];
33
34 dependencies = [
35 aiohttp
36 ];
37
38 optional-dependencies = {
39 speedups = [
40 aiodns
41 brotli
42 faust-cchardet
43 orjson
44 ];
45 };
46
47 pythonImportsCheck = [
48 "hass_client"
49 ];
50
51 # upstream has no tests
52 doCheck = false;
53
54 meta = {
55 changelog = "https://github.com/music-assistant/python-hass-client/releases/tag/${version}";
56 description = "Basic client for connecting to Home Assistant over websockets and REST";
57 homepage = "https://github.com/music-assistant/python-hass-client";
58 license = lib.licenses.asl20;
59 maintainers = with lib.maintainers; [ dotlambda ];
60 };
61}