2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
aiohttp,
|
|
|
|
ciso8601,
|
|
|
|
async-timeout,
|
|
|
|
kasa-crypt,
|
|
|
|
orjson,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
websocket-client,
|
|
|
|
websockets,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sense-energy";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "0.12.4";
|
2024-02-07 01:22:34 +00:00
|
|
|
pyproject = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scottbonline";
|
|
|
|
repo = "sense";
|
2023-01-11 07:51:40 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-jHYXqlRV1JR95GtO9E6oYj69Jj8TsvLANcI1kl7/Gl4=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
postPatch = ''
|
2023-04-29 16:46:19 +00:00
|
|
|
substituteInPlace setup.py \
|
2024-02-07 01:22:34 +00:00
|
|
|
--replace-fail "{{VERSION_PLACEHOLDER}}" "${version}"
|
2022-12-17 10:02:37 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-02-07 01:22:34 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
2023-04-29 16:46:19 +00:00
|
|
|
async-timeout
|
2023-07-15 17:15:38 +00:00
|
|
|
kasa-crypt
|
2023-04-29 16:46:19 +00:00
|
|
|
orjson
|
2023-10-09 19:29:22 +00:00
|
|
|
ciso8601
|
2021-06-28 23:13:55 +00:00
|
|
|
requests
|
|
|
|
websocket-client
|
|
|
|
websockets
|
|
|
|
];
|
|
|
|
|
|
|
|
# no tests implemented
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "sense_energy" ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "API for the Sense Energy Monitor";
|
|
|
|
homepage = "https://github.com/scottbonline/sense";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/scottbonline/sense/releases/tag/${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|