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