1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 aiohttp,
7 ciso8601,
8 async-timeout,
9 kasa-crypt,
10 orjson,
11 pythonOlder,
12 requests,
13 websocket-client,
14 websockets,
15}:
16
17buildPythonPackage rec {
18 pname = "sense-energy";
19 version = "0.13.8";
20 pyproject = true;
21
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "scottbonline";
26 repo = "sense";
27 tag = version;
28 hash = "sha256-hIE7wjKP+JcXQZ1lGbKCaKKK2ZlCF5BbJu3H7gqrsKU=";
29 };
30
31 postPatch = ''
32 substituteInPlace setup.py \
33 --replace-fail "{{VERSION_PLACEHOLDER}}" "${version}"
34 '';
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 aiohttp
40 async-timeout
41 kasa-crypt
42 orjson
43 ciso8601
44 requests
45 websocket-client
46 websockets
47 ];
48
49 # no tests implemented
50 doCheck = false;
51
52 pythonImportsCheck = [ "sense_energy" ];
53
54 meta = with lib; {
55 description = "API for the Sense Energy Monitor";
56 homepage = "https://github.com/scottbonline/sense";
57 changelog = "https://github.com/scottbonline/sense/releases/tag/${src.tag}";
58 license = licenses.mit;
59 maintainers = with maintainers; [ dotlambda ];
60 };
61}