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 = "govee-ble";
16 version = "0.31.2";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "Bluetooth-Devices";
23 repo = "govee-ble";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-aWSf80WmVopkvqCzQKHEw9McrfepZcN+fhrUP90gf5U=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail " --cov=govee_ble --cov-report=term-missing:skip-covered" ""
31 '';
32
33 build-system = [ poetry-core ];
34
35 dependencies = [
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 = [ "govee_ble" ];
45
46 meta = with lib; {
47 description = "Library for Govee BLE devices";
48 homepage = "https://github.com/Bluetooth-Devices/govee-ble";
49 changelog = "https://github.com/bluetooth-devices/govee-ble/blob/v${version}/CHANGELOG.md";
50 license = with licenses; [ mit ];
51 maintainers = with maintainers; [ fab ];
52 };
53}