1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 fetchFromGitLab,
6 flit-core,
7 ifaddr,
8 pytestCheckHook,
9 pythonOlder,
10}:
11
12buildPythonPackage rec {
13 pname = "yeelight";
14 version = "0.7.16";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitLab {
20 owner = "stavros";
21 repo = "python-yeelight";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-WLEXTDVcSpGCmfEI31cQXGf9+4EIUCkcaeaj25f4ERU=";
24 };
25
26 build-system = [ flit-core ];
27
28 dependencies = [ ifaddr ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
29
30 nativeCheckInputs = [ pytestCheckHook ];
31
32 pytestFlagsArray = [ "yeelight/tests.py" ];
33
34 pythonImportsCheck = [ "yeelight" ];
35
36 meta = with lib; {
37 description = "Python library for controlling YeeLight RGB bulbs";
38 homepage = "https://gitlab.com/stavros/python-yeelight/";
39 changelog = "https://gitlab.com/stavros/python-yeelight/-/blob/v${version}/CHANGELOG.md";
40 license = licenses.bsd2;
41 maintainers = with maintainers; [ nyanloutre ];
42 };
43}