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 = "mopeka-iot-ble";
16 version = "0.7.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "bluetooth-devices";
23 repo = pname;
24 rev = "refs/tags/v${version}";
25 hash = "sha256-wF3ZSR9kjn6qWaB7SRKsQuHfbNMwdKS/5qR9nStsw1c=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace " --cov=mopeka_iot_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 = [ "mopeka_iot_ble" ];
45
46 meta = with lib; {
47 description = "Library for Mopeka IoT BLE devices";
48 homepage = "https://github.com/bluetooth-devices/mopeka-iot-ble";
49 changelog = "https://github.com/Bluetooth-Devices/mopeka-iot-ble/releases/tag/v${version}";
50 license = with licenses; [ mit ];
51 maintainers = with maintainers; [ fab ];
52 };
53}