1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pytest-asyncio,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10 time-machine,
11 zigpy,
12}:
13
14buildPythonPackage rec {
15 pname = "zha-quirks";
16 version = "0.0.146";
17 pyproject = true;
18
19 disabled = pythonOlder "3.12";
20
21 src = fetchFromGitHub {
22 owner = "zigpy";
23 repo = "zha-device-handlers";
24 tag = version;
25 hash = "sha256-eXT0intSWAYQ/DlIEIZDbv805aQCLXYXpvhWjnd3EVA=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail ', "setuptools-git-versioning<2"' "" \
31 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
32 '';
33
34 build-system = [ setuptools ];
35
36 dependencies = [
37 aiohttp
38 zigpy
39 ];
40
41 nativeCheckInputs = [
42 pytest-asyncio
43 pytestCheckHook
44 time-machine
45 ];
46
47 disabledTests = [
48 # AssertionError: expected call not found
49 "test_moes"
50 "test_tuya_mcu_set_time"
51 ];
52
53 disabledTestPaths = [
54 # TypeError: unhashable type: 'dict'
55 "tests/test_quirks_v2.py"
56 ];
57
58 pythonImportsCheck = [ "zhaquirks" ];
59
60 meta = with lib; {
61 description = "ZHA Device Handlers are custom quirks implementations for Zigpy";
62 homepage = "https://github.com/dmulcahey/zha-device-handlers";
63 changelog = "https://github.com/zigpy/zha-device-handlers/releases/tag/${src.tag}";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ fab ];
66 platforms = platforms.linux;
67 };
68}