1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 aiocoap,
7 dtlssocket,
8 pydantic,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pytradfri";
14 version = "13.0.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.9";
18
19 src = fetchFromGitHub {
20 owner = "home-assistant-libs";
21 repo = "pytradfri";
22 rev = "refs/tags/${version}";
23 hash = "sha256-CWv3ebDulZuiFP+nJ2Xr7U/HTDFTqA9VYC0USLkpWR0=";
24 };
25
26 propagatedBuildInputs = [ pydantic ];
27
28 passthru.optional-dependencies = {
29 async = [
30 aiocoap
31 dtlssocket
32 ];
33 };
34
35 nativeCheckInputs = [ pytestCheckHook ] ++ passthru.optional-dependencies.async;
36
37 pythonImportsCheck = [ "pytradfri" ];
38
39 meta = with lib; {
40 description = "Python package to communicate with the IKEA Trådfri ZigBee Gateway";
41 homepage = "https://github.com/home-assistant-libs/pytradfri";
42 changelog = "https://github.com/home-assistant-libs/pytradfri/releases/tag/${version}";
43 license = licenses.mit;
44 maintainers = with maintainers; [ dotlambda ];
45 # https://github.com/home-assistant-libs/pytradfri/issues/720
46 broken = versionAtLeast pydantic.version "2";
47 };
48}