1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 pythonOlder,
7
8 # build-system
9 poetry-core,
10 setuptools,
11
12 # dependencies
13 habluetooth,
14
15 # tests
16 bleak,
17 pytest-cov-stub,
18 pytestCheckHook,
19}:
20
21buildPythonPackage rec {
22 pname = "home-assistant-bluetooth";
23 version = "1.13.1";
24 pyproject = true;
25
26 disabled = pythonOlder "3.11";
27
28 src = fetchFromGitHub {
29 owner = "home-assistant-libs";
30 repo = "home-assistant-bluetooth";
31 tag = "v${version}";
32 hash = "sha256-piX812Uzd2F8A8+IF/17N+xy6ENpfRVJ1BxsAxL5aj0=";
33 };
34
35 patches = [
36 (fetchpatch {
37 name = "fix-tests-with-habluetooth-3.42.0.patch";
38 url = "https://github.com/home-assistant-libs/home-assistant-bluetooth/commit/515516bf9b2577c5d4af25cd2f052023ccb8b108.patch";
39 includes = [ "tests/test_models.py" ];
40 hash = "sha256-9t8VRKQSDxSYiy7bFII62B4O5w5Hx9AbRgvzcT6z1BQ=";
41 })
42 ];
43
44 build-system = [
45 poetry-core
46 setuptools
47 ];
48
49 dependencies = [ habluetooth ];
50
51 nativeCheckInputs = [
52 bleak
53 pytest-cov-stub
54 pytestCheckHook
55 ];
56
57 pythonImportsCheck = [ "home_assistant_bluetooth" ];
58
59 meta = {
60 description = "Basic bluetooth models used by Home Assistant";
61 changelog = "https://github.com/home-assistant-libs/home-assistant-bluetooth/blob/${src.tag}/CHANGELOG.md";
62 homepage = "https://github.com/home-assistant-libs/home-assistant-bluetooth";
63 license = lib.licenses.asl20;
64 teams = [ lib.teams.home-assistant ];
65 };
66}