1{
2 lib,
3 aiohttp,
4 aresponses,
5 async-timeout,
6 buildPythonPackage,
7 fetchFromGitHub,
8 poetry-core,
9 pytest-asyncio,
10 pytestCheckHook,
11 pythonOlder,
12 syrupy,
13}:
14
15buildPythonPackage rec {
16 pname = "python-homewizard-energy";
17 version = "6.0.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "DCSBL";
24 repo = "python-homewizard-energy";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-tOoNC9MysL5PcIa1N/GjzNy+4+ovZGQznYYDt1o6f4c=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 aiohttp
38 async-timeout
39 ];
40
41 __darwinAllowLocalNetworking = true;
42
43 nativeCheckInputs = [
44 aresponses
45 pytest-asyncio
46 pytestCheckHook
47 syrupy
48 ];
49
50 pythonImportsCheck = [ "homewizard_energy" ];
51
52 meta = with lib; {
53 description = "Library to communicate with HomeWizard Energy devices";
54 homepage = "https://github.com/homewizard/python-homewizard-energy";
55 changelog = "https://github.com/homewizard/python-homewizard-energy/releases/tag/v${version}";
56 license = licenses.asl20;
57 maintainers = with maintainers; [ fab ];
58 };
59}