1{
2 lib,
3 aenum,
4 aiohttp,
5 aiohttp-wsgi,
6 async-timeout,
7 buildPythonPackage,
8 fetchFromGitHub,
9 pytest7CheckHook,
10 pythonAtLeast,
11 pythonOlder,
12 pytest-aiohttp,
13 pytest-asyncio,
14 requests,
15 setuptools,
16 setuptools-scm,
17 websocket-client,
18 websockets,
19}:
20
21buildPythonPackage rec {
22 pname = "homematicip";
23 version = "1.1.1";
24 pyproject = true;
25
26 disabled = pythonOlder "3.10";
27
28 src = fetchFromGitHub {
29 owner = "hahn-th";
30 repo = "homematicip-rest-api";
31 rev = "refs/tags/${version}";
32 hash = "sha256-VMHInAmNO0Nw0ohZnIJ9c77h35YSSNNnPNYaUpBlKOQ=";
33 };
34
35 build-system = [
36 setuptools
37 setuptools-scm
38 ];
39
40 dependencies = [
41 aenum
42 aiohttp
43 async-timeout
44 requests
45 websocket-client
46 websockets
47 ];
48
49 nativeCheckInputs = [
50 aiohttp-wsgi
51 pytest-aiohttp
52 pytest-asyncio
53 pytest7CheckHook
54 ];
55
56 pytestFlagsArray = [ "--asyncio-mode=auto" ];
57
58 disabledTests =
59 [
60 # Assert issues with datetime
61 "test_contact_interface_device"
62 "test_dimmer"
63 "test_external_device"
64 "test_heating_failure_alert_group"
65 "test_heating"
66 "test_humidity_warning_rule_group"
67 "test_meta_group"
68 "test_pluggable_switch_measuring"
69 "test_rotary_handle_sensor"
70 "test_security_group"
71 "test_security_zone"
72 "test_shutter_device"
73 "test_smoke_detector"
74 "test_switching_group"
75 "test_temperature_humidity_sensor_outdoor"
76 "test_wall_mounted_thermostat_pro"
77 "test_weather_sensor"
78 # Random failures
79 "test_home_getSecurityJournal"
80 "test_home_unknown_types"
81 # Requires network access
82 "test_websocket"
83 ]
84 ++ lib.optionals (pythonAtLeast "3.10") [
85 "test_connection_lost"
86 "test_user_disconnect_and_reconnect"
87 "test_ws_message"
88 "test_ws_no_pong"
89 ];
90
91 pythonImportsCheck = [ "homematicip" ];
92
93 meta = with lib; {
94 description = "Module for the homematicIP REST API";
95 homepage = "https://github.com/hahn-th/homematicip-rest-api";
96 changelog = "https://github.com/hahn-th/homematicip-rest-api/releases/tag/${version}";
97 license = with licenses; [ gpl3Only ];
98 maintainers = with maintainers; [ fab ];
99 };
100}