2021-05-16 00:44:37 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, requests
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "growattserver";
|
2021-08-16 18:04:42 +01:00
|
|
|
version = "1.0.2";
|
2021-05-16 00:44:37 +01:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "indykoning";
|
|
|
|
repo = "PyPi_GrowattServer";
|
|
|
|
rev = version;
|
2021-08-16 18:04:42 +01:00
|
|
|
sha256 = "sha256-0i7pMJ4gAVOkvj2uYZJygr3rehgIAfyxq9cWbozwRIQ=";
|
2021-05-16 00:44:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# https://github.com/indykoning/PyPi_GrowattServer/issues/2
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "tag = os.environ['LATEST_TAG']" "" \
|
|
|
|
--replace "version=tag," 'version="${version}",'
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Project has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "growattServer" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python package to retrieve information from Growatt units";
|
|
|
|
homepage = "https://github.com/indykoning/PyPi_GrowattServer";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|