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