1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 fetchFromGitHub,
6 pytest-asyncio,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10 zigpy,
11}:
12
13buildPythonPackage rec {
14 pname = "zha-quirks";
15 version = "0.0.139";
16 pyproject = true;
17
18 disabled = pythonOlder "3.12";
19
20 src = fetchFromGitHub {
21 owner = "zigpy";
22 repo = "zha-device-handlers";
23 tag = version;
24 hash = "sha256-16gv2t1hudIULybmAXK+sMl9MsFATHMGQeZWhmVhrkk=";
25 };
26
27 postPatch = ''
28 substituteInPlace pyproject.toml \
29 --replace-fail ', "setuptools-git-versioning<2"' "" \
30 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
31 '';
32
33 build-system = [ setuptools ];
34
35 dependencies = [
36 aiohttp
37 zigpy
38 ];
39
40 nativeCheckInputs = [
41 pytest-asyncio
42 pytestCheckHook
43 ];
44
45 disabledTests = [
46 # RuntimeError: no running event loop
47 "test_mfg_cluster_events"
48 "test_co2_sensor"
49 "test_smart_air_sensor"
50 ];
51
52 pythonImportsCheck = [ "zhaquirks" ];
53
54 meta = with lib; {
55 description = "ZHA Device Handlers are custom quirks implementations for Zigpy";
56 homepage = "https://github.com/dmulcahey/zha-device-handlers";
57 changelog = "https://github.com/zigpy/zha-device-handlers/releases/tag/${src.tag}";
58 license = licenses.asl20;
59 maintainers = with maintainers; [ fab ];
60 platforms = platforms.linux;
61 };
62}