1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, mock
5, noiseprotocol
6, protobuf
7, pytest-asyncio
8, pytestCheckHook
9, pythonOlder
10, zeroconf
11}:
12
13buildPythonPackage rec {
14 pname = "aioesphomeapi";
15 version = "11.5.0";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchFromGitHub {
21 owner = "esphome";
22 repo = pname;
23 rev = "refs/tags/v${version}";
24 hash = "sha256-z3ILdtxDU4xLBY5mVAKal2nBo2sdO5rlSQDyexwHUtI=";
25 };
26
27 postPatch = ''
28 substituteInPlace requirements.txt \
29 --replace "protobuf>=3.12.2,<4.0" "protobuf>=3.12.2"
30 '';
31
32 propagatedBuildInputs = [
33 noiseprotocol
34 protobuf
35 zeroconf
36 ];
37
38 checkInputs = [
39 mock
40 pytest-asyncio
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [
45 "aioesphomeapi"
46 ];
47
48 meta = with lib; {
49 description = "Python Client for ESPHome native API";
50 homepage = "https://github.com/esphome/aioesphomeapi";
51 license = licenses.mit;
52 maintainers = with maintainers; [ fab hexa ];
53 };
54}