1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 aiocoap,
7 dtlssocket,
8 pydantic,
9 pytest-asyncio,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "pytradfri";
15 version = "14.0.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "home-assistant-libs";
20 repo = "pytradfri";
21 tag = version;
22 hash = "sha256-oYYi1P0Zu9PLsacUW//BlJlLmeOVvHgb/lR52KwZ7N8=";
23 };
24
25 build-system = [ setuptools ];
26
27 dependencies = [ pydantic ];
28
29 optional-dependencies = {
30 async = [
31 aiocoap
32 dtlssocket
33 ];
34 };
35
36 nativeCheckInputs = [
37 pytest-asyncio
38 pytestCheckHook
39 ]
40 ++ optional-dependencies.async;
41
42 pythonImportsCheck = [ "pytradfri" ];
43
44 meta = with lib; {
45 description = "Python package to communicate with the IKEA Trådfri ZigBee Gateway";
46 homepage = "https://github.com/home-assistant-libs/pytradfri";
47 changelog = "https://github.com/home-assistant-libs/pytradfri/releases/tag/${src.tag}";
48 license = licenses.mit;
49 maintainers = with maintainers; [ dotlambda ];
50 };
51}