1{
2 lib,
3 aiohttp,
4 aiooui,
5 async-timeout,
6 bleak,
7 buildPythonPackage,
8 dbus-fast,
9 fetchFromGitHub,
10 mac-vendor-lookup,
11 myst-parser,
12 poetry-core,
13 pytestCheckHook,
14 pythonOlder,
15 sphinx-rtd-theme,
16 sphinxHook,
17 uart-devices,
18 usb-devices,
19}:
20
21buildPythonPackage rec {
22 pname = "bluetooth-adapters";
23 version = "0.19.2";
24 pyproject = true;
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "Bluetooth-Devices";
30 repo = "bluetooth-adapters";
31 rev = "refs/tags/v${version}";
32 hash = "sha256-hPs6YnmndJ2Z5RotcIRIYWPdvMyX56ul84l1Cs8kqH0=";
33 };
34
35 postPatch = ''
36 # Drop pytest arguments (coverage, ...)
37 sed -i '/addopts/d' pyproject.toml
38 '';
39
40 outputs = [
41 "out"
42 "doc"
43 ];
44
45 build-system = [
46 myst-parser
47 poetry-core
48 sphinx-rtd-theme
49 sphinxHook
50 ];
51
52 dependencies = [
53 aiohttp
54 aiooui
55 async-timeout
56 bleak
57 dbus-fast
58 mac-vendor-lookup
59 uart-devices
60 usb-devices
61 ];
62
63 pythonImportsCheck = [ "bluetooth_adapters" ];
64
65 nativeCheckInputs = [ pytestCheckHook ];
66
67 meta = with lib; {
68 description = "Tools to enumerate and find Bluetooth Adapters";
69 homepage = "https://github.com/Bluetooth-Devices/bluetooth-adapters";
70 changelog = "https://github.com/bluetooth-devices/bluetooth-adapters/blob/v${version}/CHANGELOG.md";
71 license = licenses.asl20;
72 maintainers = teams.home-assistant.members;
73 };
74}