1{
2 lib,
3 aioesphomeapi,
4 bleak,
5 bluetooth-data-tools,
6 buildPythonPackage,
7 fetchFromGitHub,
8 habluetooth,
9 lru-dict,
10 poetry-core,
11 pytest-asyncio,
12 pytestCheckHook,
13 pythonOlder,
14}:
15
16buildPythonPackage rec {
17 pname = "bleak-esphome";
18 version = "1.0.0";
19 pyproject = true;
20
21 disabled = pythonOlder "3.10";
22
23 src = fetchFromGitHub {
24 owner = "bluetooth-devices";
25 repo = "bleak-esphome";
26 rev = "refs/tags/v${version}";
27 hash = "sha256-zz7vh+UIahHtb6ZjR/eRrS9RGur2klqbgKoeJpMrH/k=";
28 };
29
30 postPatch = ''
31 substituteInPlace pyproject.toml \
32 --replace " --cov=bleak_esphome --cov-report=term-missing:skip-covered" ""
33 '';
34
35 nativeBuildInputs = [ poetry-core ];
36
37 propagatedBuildInputs = [
38 aioesphomeapi
39 bleak
40 bluetooth-data-tools
41 habluetooth
42 lru-dict
43 ];
44
45 nativeCheckInputs = [
46 pytest-asyncio
47 pytestCheckHook
48 ];
49
50 pythonImportsCheck = [ "bleak_esphome" ];
51
52 meta = with lib; {
53 description = "Bleak backend of ESPHome";
54 homepage = "https://github.com/bluetooth-devices/bleak-esphome";
55 changelog = "https://github.com/bluetooth-devices/bleak-esphome/blob/v${version}/CHANGELOG.md";
56 license = licenses.mit;
57 maintainers = with maintainers; [ fab ];
58 };
59}