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