1{
2 lib,
3 bleak-retry-connector,
4 bleak,
5 bluetooth-data-tools,
6 bluetooth-sensor-state-data,
7 buildPythonPackage,
8 cryptography,
9 fetchFromGitHub,
10 home-assistant-bluetooth,
11 orjson,
12 poetry-core,
13 pycryptodomex,
14 pytest-cov-stub,
15 pytestCheckHook,
16 pythonOlder,
17 sensor-state-data,
18}:
19
20buildPythonPackage rec {
21 pname = "xiaomi-ble";
22 version = "1.2.0";
23 pyproject = true;
24
25 disabled = pythonOlder "3.9";
26
27 src = fetchFromGitHub {
28 owner = "Bluetooth-Devices";
29 repo = "xiaomi-ble";
30 tag = "v${version}";
31 hash = "sha256-elPT+hwnFoy62CbpKsaTLP8D+Pui6BD2De7oJistM0w=";
32 };
33
34 build-system = [ poetry-core ];
35
36 pythonRelaxDeps = [ "pycryptodomex" ];
37
38 dependencies = [
39 bleak
40 bleak-retry-connector
41 bluetooth-data-tools
42 bluetooth-sensor-state-data
43 cryptography
44 home-assistant-bluetooth
45 orjson
46 pycryptodomex
47 sensor-state-data
48 ];
49
50 nativeCheckInputs = [
51 pytest-cov-stub
52 pytestCheckHook
53 ];
54
55 pythonImportsCheck = [ "xiaomi_ble" ];
56
57 meta = with lib; {
58 description = "Library for Xiaomi BLE devices";
59 homepage = "https://github.com/Bluetooth-Devices/xiaomi-ble";
60 changelog = "https://github.com/Bluetooth-Devices/xiaomi-ble/releases/tag/${src.tag}";
61 license = licenses.mit;
62 maintainers = with maintainers; [ fab ];
63 };
64}