1{
2 lib,
3 buildPythonPackage,
4 aiocoap,
5 aiohappyeyeballs,
6 async-interrupt,
7 bleak,
8 bleak-retry-connector,
9 chacha20poly1305,
10 chacha20poly1305-reuseable,
11 commentjson,
12 cryptography,
13 fetchFromGitHub,
14 orjson,
15 poetry-core,
16 pytest-aiohttp,
17 pytestCheckHook,
18 pythonOlder,
19 zeroconf,
20}:
21
22buildPythonPackage rec {
23 pname = "aiohomekit";
24 version = "3.1.5";
25 pyproject = true;
26
27 disabled = pythonOlder "3.10";
28
29 src = fetchFromGitHub {
30 owner = "Jc2k";
31 repo = "aiohomekit";
32 rev = "refs/tags/${version}";
33 hash = "sha256-F3PhZsuIgT3x1Y3/kx9juPwN2WKxvdbahrRm+r6ZPps=";
34 };
35
36 nativeBuildInputs = [ poetry-core ];
37
38 propagatedBuildInputs = [
39 aiocoap
40 aiohappyeyeballs
41 async-interrupt
42 bleak
43 bleak-retry-connector
44 chacha20poly1305
45 chacha20poly1305-reuseable
46 commentjson
47 cryptography
48 orjson
49 zeroconf
50 ];
51
52 doCheck = lib.versionAtLeast pytest-aiohttp.version "1.0.0";
53
54 nativeCheckInputs = [
55 pytest-aiohttp
56 pytestCheckHook
57 ];
58
59 disabledTestPaths = [
60 # Tests require network access
61 "tests/test_ip_pairing.py"
62 ];
63
64 disabledTests = [
65 # AttributeError: 'MockedAsyncServiceInfo' object has no attribute '_set_properties'
66 "test_discover_find_one_unpaired"
67 "test_find_device_id_case_lower"
68 "test_find_device_id_case_upper"
69 "test_discover_missing_csharp"
70 "test_discover_csharp_case"
71 "test_discover_device_id_case_lower"
72 "test_discover_device_id_case_upper"
73 ];
74
75 pythonImportsCheck = [ "aiohomekit" ];
76
77 meta = with lib; {
78 description = "Python module that implements the HomeKit protocol";
79 mainProgram = "aiohomekitctl";
80 longDescription = ''
81 This Python library implements the HomeKit protocol for controlling
82 Homekit accessories.
83 '';
84 homepage = "https://github.com/Jc2k/aiohomekit";
85 changelog = "https://github.com/Jc2k/aiohomekit/releases/tag/${version}";
86 license = with licenses; [ asl20 ];
87 maintainers = with maintainers; [ fab ];
88 };
89}