1{ lib
2, bleak-retry-connector
3, bluetooth-data-tools
4, bluetooth-sensor-state-data
5, buildPythonPackage
6, fetchFromGitHub
7, home-assistant-bluetooth
8, poetry-core
9, pycryptodomex
10, pytestCheckHook
11, pythonOlder
12, sensor-state-data
13}:
14
15buildPythonPackage rec {
16 pname = "xiaomi-ble";
17 version = "0.11.0";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "Bluetooth-Devices";
24 repo = pname;
25 rev = "v${version}";
26 hash = "sha256-qAqXg+skA7FfAjRXljt1UpyOcC3KYghc+5wjiRzlyyg=";
27 };
28
29 nativeBuildInputs = [
30 poetry-core
31 ];
32
33 propagatedBuildInputs = [
34 bleak-retry-connector
35 bluetooth-data-tools
36 bluetooth-sensor-state-data
37 home-assistant-bluetooth
38 pycryptodomex
39 sensor-state-data
40 ];
41
42 checkInputs = [
43 pytestCheckHook
44 ];
45
46 postPatch = ''
47 substituteInPlace pyproject.toml \
48 --replace " --cov=xiaomi_ble --cov-report=term-missing:skip-covered" ""
49 '';
50
51 pythonImportsCheck = [
52 "xiaomi_ble"
53 ];
54
55 meta = with lib; {
56 description = "Library for Xiaomi BLE devices";
57 homepage = "https://github.com/Bluetooth-Devices/xiaomi-ble";
58 license = with licenses; [ mit ];
59 maintainers = with maintainers; [ fab ];
60 };
61}