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