1{
2 lib,
3 aioesphomeapi,
4 bleak,
5 bleak-retry-connector,
6 bluetooth-data-tools,
7 buildPythonPackage,
8 cython,
9 fetchFromGitHub,
10 habluetooth,
11 lru-dict,
12 poetry-core,
13 pytest-asyncio,
14 pytest-codspeed,
15 pytest-cov-stub,
16 pytestCheckHook,
17 setuptools,
18}:
19
20buildPythonPackage rec {
21 pname = "bleak-esphome";
22 version = "3.3.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "bluetooth-devices";
27 repo = "bleak-esphome";
28 tag = "v${version}";
29 hash = "sha256-1rsTXIWowwxycJYs2Aw2FXwQHSK1T7t2RODxqq1KxOs=";
30 };
31
32 postPatch = ''
33 substituteInPlace pyproject.toml \
34 --replace-fail "setuptools>=75.8.2" setuptools
35 '';
36
37 build-system = [
38 cython
39 poetry-core
40 setuptools
41 ];
42
43 dependencies = [
44 aioesphomeapi
45 bleak
46 bleak-retry-connector
47 bluetooth-data-tools
48 habluetooth
49 lru-dict
50 ];
51
52 nativeCheckInputs = [
53 pytest-asyncio
54 pytest-codspeed
55 pytest-cov-stub
56 pytestCheckHook
57 ];
58
59 disabledTests = [
60 # bleak_client.services.get_characteristic returns None
61 "test_client_get_services_and_read_write"
62 "test_bleak_client_get_services_and_read_write"
63 "test_bleak_client_cached_get_services_and_read_write"
64 ];
65
66 pythonImportsCheck = [ "bleak_esphome" ];
67
68 meta = with lib; {
69 description = "Bleak backend of ESPHome";
70 homepage = "https://github.com/bluetooth-devices/bleak-esphome";
71 changelog = "https://github.com/bluetooth-devices/bleak-esphome/blob/${src.tag}/CHANGELOG.md";
72 license = licenses.mit;
73 maintainers = with maintainers; [ fab ];
74 };
75}