1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build-system
7, cython_3
8, setuptools
9
10# dependencies
11, async-timeout
12, chacha20poly1305-reuseable
13, noiseprotocol
14, protobuf
15, zeroconf
16
17# tests
18, mock
19, pytest-asyncio
20, pytestCheckHook
21}:
22
23buildPythonPackage rec {
24 pname = "aioesphomeapi";
25 version = "18.5.2";
26 pyproject = true;
27
28 disabled = pythonOlder "3.9";
29
30 src = fetchFromGitHub {
31 owner = "esphome";
32 repo = pname;
33 rev = "refs/tags/v${version}";
34 hash = "sha256-kj4FHsNsGsMxK+EI1jgqBfvldkyAoBkCTGT1yiZMmzY=";
35 };
36
37 nativeBuildInputs = [
38 setuptools
39 cython_3
40 ];
41
42 propagatedBuildInputs = [
43 chacha20poly1305-reuseable
44 noiseprotocol
45 protobuf
46 zeroconf
47 ] ++ lib.optionals (pythonOlder "3.11") [
48 async-timeout
49 ];
50
51 pythonImportsCheck = [
52 "aioesphomeapi"
53 ];
54 nativeCheckInputs = [
55 mock
56 pytest-asyncio
57 pytestCheckHook
58 ];
59
60 meta = with lib; {
61 changelog = "https://github.com/esphome/aioesphomeapi/releases/tag/v${version}";
62 description = "Python Client for ESPHome native API";
63 homepage = "https://github.com/esphome/aioesphomeapi";
64 license = licenses.mit;
65 maintainers = with maintainers; [ fab hexa ];
66 };
67}