2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, aiohttp
|
|
|
|
, xmltodict
|
2023-02-22 10:55:15 +00:00
|
|
|
, python-socketio
|
|
|
|
, websocket-client
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pycontrol4";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "1.1.0";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lawtancool";
|
|
|
|
repo = "pyControl4";
|
|
|
|
rev = "v${version}";
|
2023-02-22 10:55:15 +00:00
|
|
|
hash = "sha256-dMv2b6dbMauPvPf4LHKmLF4jnXYRYe6A+2lDtiZDUhY=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "python-socketio>=4,<5" "python-socketio>=4"
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
xmltodict
|
2023-02-22 10:55:15 +00:00
|
|
|
python-socketio
|
|
|
|
websocket-client
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# tests access network
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pyControl4.account"
|
|
|
|
"pyControl4.alarm"
|
|
|
|
"pyControl4.director"
|
|
|
|
"pyControl4.light"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python 3 asyncio package for interacting with Control4 systems";
|
|
|
|
homepage = "https://github.com/lawtancool/pyControl4";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|