1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 cython,
9 setuptools,
10
11 # dependencies
12 aiohappyeyeballs,
13 async-interrupt,
14 async-timeout,
15 chacha20poly1305-reuseable,
16 cryptography,
17 noiseprotocol,
18 protobuf,
19 zeroconf,
20
21 # tests
22 mock,
23 pytest-asyncio,
24 pytestCheckHook,
25}:
26
27buildPythonPackage rec {
28 pname = "aioesphomeapi";
29 version = "24.6.1";
30 pyproject = true;
31
32 disabled = pythonOlder "3.9";
33
34 src = fetchFromGitHub {
35 owner = "esphome";
36 repo = "aioesphomeapi";
37 rev = "refs/tags/v${version}";
38 hash = "sha256-wvfAkV+EjGytPog3ik7NAC0rW8nkHufenGfapeQr1X0=";
39 };
40
41 build-system = [
42 setuptools
43 cython
44 ];
45
46 dependencies = [
47 aiohappyeyeballs
48 async-interrupt
49 chacha20poly1305-reuseable
50 cryptography
51 noiseprotocol
52 protobuf
53 zeroconf
54 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
55
56 nativeCheckInputs = [
57 mock
58 pytest-asyncio
59 pytestCheckHook
60 ];
61
62 disabledTests = [
63 # https://github.com/esphome/aioesphomeapi/issues/837
64 "test_reconnect_logic_stop_callback"
65 # python3.12.4 regression
66 # https://github.com/esphome/aioesphomeapi/issues/889
67 "test_start_connection_cannot_increase_recv_buffer"
68 "test_start_connection_can_only_increase_buffer_size_to_262144"
69 ];
70
71 pythonImportsCheck = [ "aioesphomeapi" ];
72
73 meta = with lib; {
74 description = "Python Client for ESPHome native API";
75 homepage = "https://github.com/esphome/aioesphomeapi";
76 changelog = "https://github.com/esphome/aioesphomeapi/releases/tag/v${version}";
77 license = licenses.mit;
78 maintainers = with maintainers; [
79 fab
80 hexa
81 ];
82 };
83}