2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, netifaces
|
|
|
|
, pycryptodome
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "greeclimate";
|
2022-01-19 23:45:15 +00:00
|
|
|
version = "1.0.2";
|
2021-12-06 16:07:01 +00:00
|
|
|
format = "setuptools";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cmroche";
|
|
|
|
repo = "greeclimate";
|
2022-01-03 16:56:52 +00:00
|
|
|
rev = "v${version}";
|
2022-01-19 23:45:15 +00:00
|
|
|
hash = "sha256-Y8IgqrU8zzV020qwyyb57Tp2j7laQ3JsCOCYBuf8vsQ=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
# upstream issue for proper solution https://github.com/cmroche/greeclimate/issues/46
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'name="greeclimate",' 'name="greeclimate",version="${version}",'
|
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
netifaces
|
|
|
|
pycryptodome
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"greeclimate"
|
|
|
|
"greeclimate.device"
|
|
|
|
"greeclimate.discovery"
|
|
|
|
"greeclimate.exceptions"
|
|
|
|
"greeclimate.network"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Discover, connect and control Gree based minisplit systems";
|
|
|
|
homepage = "https://github.com/cmroche/greeclimate";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|