1{
2 lib,
3 aiohttp,
4 asyncio-dgram,
5 buildPythonPackage,
6 certifi,
7 fetchFromGitHub,
8 frozenlist,
9 poetry-core,
10 pytest-aiohttp,
11 pytest-asyncio,
12 pytestCheckHook,
13 pythonOlder,
14 voluptuous,
15 typing-extensions,
16 yarl,
17}:
18
19buildPythonPackage rec {
20 pname = "aioguardian";
21 version = "2025.02.0";
22 pyproject = true;
23
24 disabled = pythonOlder "3.11";
25
26 src = fetchFromGitHub {
27 owner = "bachya";
28 repo = "aioguardian";
29 tag = version;
30 hash = "sha256-RoVD2O/OAk4l96kYEq7ZM/2QuckcPxDluf1MT4HdKc4=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace-fail poetry-core==2.0.1 poetry-core
36 '';
37
38 pythonRelaxDeps = [
39 "asyncio_dgram"
40 "typing-extensions"
41 ];
42
43 build-system = [ poetry-core ];
44
45 dependencies = [
46 aiohttp
47 asyncio-dgram
48 certifi
49 frozenlist
50 voluptuous
51 typing-extensions
52 yarl
53 ];
54
55 nativeCheckInputs = [
56 asyncio-dgram
57 pytest-aiohttp
58 pytest-asyncio
59 pytestCheckHook
60 ];
61
62 disabledTestPaths = [ "examples/" ];
63
64 pythonImportsCheck = [ "aioguardian" ];
65
66 meta = with lib; {
67 description = " Python library to interact with Elexa Guardian devices";
68 longDescription = ''
69 aioguardian is an asyncio-focused library for interacting with the
70 Guardian line of water valves and sensors from Elexa.
71 '';
72 homepage = "https://github.com/bachya/aioguardian";
73 changelog = "https://github.com/bachya/aioguardian/releases/tag/${version}";
74 license = with licenses; [ mit ];
75 maintainers = with maintainers; [ fab ];
76 };
77}