1{ lib
2, bleak
3, bleak-retry-connector
4, buildPythonPackage
5, fetchFromGitHub
6, poetry-core
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "airthings-ble";
12 version = "0.5.6-4";
13 format = "pyproject";
14
15 disabled = pythonOlder "3.9";
16
17 src = fetchFromGitHub {
18 owner = "vincegio";
19 repo = pname;
20 rev = "refs/tags/v${version}";
21 hash = "sha256-Ft5A2ZGVH9VHoRDAqDcc0rBfnQRxoXMylCAwUSwmViE=";
22 };
23
24 postPatch = ''
25 substituteInPlace pyproject.toml \
26 --replace 'bleak-retry-connector = "^0.15.1"' 'bleak = "*"'
27 '';
28
29 nativeBuildInputs = [
30 poetry-core
31 ];
32
33 propagatedBuildInputs = [
34 bleak
35 bleak-retry-connector
36 ];
37
38 # Module has no tests
39 doCheck = false;
40
41 pythonImportsCheck = [
42 "airthings_ble"
43 ];
44
45 meta = with lib; {
46 description = "Library for Airthings BLE devices";
47 homepage = "https://github.com/vincegio/airthings-ble";
48 changelog = "https://github.com/vincegio/airthings-ble/releases/tag/v${version}";
49 license = with licenses; [ mit ];
50 maintainers = with maintainers; [ fab ];
51 };
52}