1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools,
7 aiohttp,
8 xmltodict,
9 python-socketio,
10 websocket-client,
11}:
12
13buildPythonPackage rec {
14 pname = "pycontrol4";
15 version = "1.1.2";
16
17 disabled = pythonOlder "3.6";
18
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "lawtancool";
23 repo = "pyControl4";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-oKKc9s3/fO7cFMjOeKtpvEwmfglxI2lxlN3EIva7zR8=";
26 };
27
28 postPatch = ''
29 substituteInPlace setup.py \
30 --replace "python-socketio>=4,<5" "python-socketio>=4"
31 '';
32
33 nativeBuildInputs = [ setuptools ];
34
35 propagatedBuildInputs = [
36 aiohttp
37 xmltodict
38 python-socketio
39 websocket-client
40 ];
41
42 # tests access network
43 doCheck = false;
44
45 pythonImportsCheck = [
46 "pyControl4.account"
47 "pyControl4.alarm"
48 "pyControl4.director"
49 "pyControl4.light"
50 ];
51
52 meta = with lib; {
53 description = "Python 3 asyncio package for interacting with Control4 systems";
54 homepage = "https://github.com/lawtancool/pyControl4";
55 license = licenses.asl20;
56 maintainers = with maintainers; [ dotlambda ];
57 };
58}