python-duco-connectivity 0.15.0__tar.gz → 0.16.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_duco_connectivity-0.15.0/src/python_duco_connectivity.egg-info → python_duco_connectivity-0.16.0}/PKG-INFO +13 -1
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/README.md +12 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/pyproject.toml +1 -1
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/__init__.py +2 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/cli.py +3 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/client.py +84 -28
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/models.py +12 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0/src/python_duco_connectivity.egg-info}/PKG-INFO +13 -1
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_client.py +122 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/LICENSE +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/setup.cfg +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/__main__.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/exceptions.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/py.typed +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/python_duco_connectivity.egg-info/SOURCES.txt +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/python_duco_connectivity.egg-info/dependency_links.txt +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/python_duco_connectivity.egg-info/entry_points.txt +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/python_duco_connectivity.egg-info/requires.txt +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/python_duco_connectivity.egg-info/top_level.txt +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_api_reference.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_cli.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_exceptions.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_local_sample_validation.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_models.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_pytest_live_support.py +0 -0
- {python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_replay_helpers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-duco-connectivity
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Async HTTP client for the local Duco Connectivity API
|
|
5
5
|
Author: Ronald van der Meer
|
|
6
6
|
License-Expression: MIT
|
|
@@ -64,6 +64,7 @@ in the development examples below.
|
|
|
64
64
|
- asynchronous communication via `aiohttp`
|
|
65
65
|
- typed stable config families for the documented `/config` branches
|
|
66
66
|
- typed helpers for stable `/info` fields such as heat recovery filter time
|
|
67
|
+
- a typed overview for selected values from one unfiltered `/info` request
|
|
67
68
|
- natural empty results for optional capability discovery and explicit errors
|
|
68
69
|
for strict capability access
|
|
69
70
|
- typed models that stay close to the API response shape
|
|
@@ -97,6 +98,13 @@ pre-0.13 raw status string remains compatible and derives `raw_status`
|
|
|
97
98
|
automatically; callers using a normalized `DiagStatus` must provide
|
|
98
99
|
`raw_status` explicitly.
|
|
99
100
|
|
|
101
|
+
`async_get_info_overview()` combines RSSI, diagnostic subsystems, heat recovery
|
|
102
|
+
filter time, and ventilation temperatures from one `GET /info` request. Missing
|
|
103
|
+
product-specific modules produce their natural empty values. Unlike most typed
|
|
104
|
+
models, `InfoOverview` does not retain the broad response or the LAN raw
|
|
105
|
+
payload, because that response can contain network credentials such as the
|
|
106
|
+
Wi-Fi access point key.
|
|
107
|
+
|
|
100
108
|
## Getting started
|
|
101
109
|
|
|
102
110
|
```python
|
|
@@ -111,9 +119,11 @@ async def main() -> None:
|
|
|
111
119
|
async with aiohttp.ClientSession() as session:
|
|
112
120
|
client = DucoClient(session, "192.168.1.10")
|
|
113
121
|
api_info = await client.async_get_api_info()
|
|
122
|
+
info = await client.async_get_info_overview()
|
|
114
123
|
nodes = await client.async_get_nodes_overview()
|
|
115
124
|
|
|
116
125
|
print(api_info.public_api_version)
|
|
126
|
+
print(info.rssi_wifi)
|
|
117
127
|
print([node.node_id for node in nodes])
|
|
118
128
|
|
|
119
129
|
|
|
@@ -129,6 +139,8 @@ public client methods, exports, compatibility aliases, and construction rules.
|
|
|
129
139
|
- `docs/api-reference.md` for the central public API inventory
|
|
130
140
|
- `docs/cli.md` for the function probe CLI and shell examples
|
|
131
141
|
- `docs/config.md` for system, node, and zone config reads and writes
|
|
142
|
+
- `docs/endpoint-inventory.md` for the Public API 2.5 read routes and observed
|
|
143
|
+
response shapes across tested Duco products
|
|
132
144
|
- `docs/live-testing.md` for local opt-in tests against a real Duco device
|
|
133
145
|
- `docs/replay-testing.md` for local sample validation against ignored raw API
|
|
134
146
|
captures
|
|
@@ -32,6 +32,7 @@ in the development examples below.
|
|
|
32
32
|
- asynchronous communication via `aiohttp`
|
|
33
33
|
- typed stable config families for the documented `/config` branches
|
|
34
34
|
- typed helpers for stable `/info` fields such as heat recovery filter time
|
|
35
|
+
- a typed overview for selected values from one unfiltered `/info` request
|
|
35
36
|
- natural empty results for optional capability discovery and explicit errors
|
|
36
37
|
for strict capability access
|
|
37
38
|
- typed models that stay close to the API response shape
|
|
@@ -65,6 +66,13 @@ pre-0.13 raw status string remains compatible and derives `raw_status`
|
|
|
65
66
|
automatically; callers using a normalized `DiagStatus` must provide
|
|
66
67
|
`raw_status` explicitly.
|
|
67
68
|
|
|
69
|
+
`async_get_info_overview()` combines RSSI, diagnostic subsystems, heat recovery
|
|
70
|
+
filter time, and ventilation temperatures from one `GET /info` request. Missing
|
|
71
|
+
product-specific modules produce their natural empty values. Unlike most typed
|
|
72
|
+
models, `InfoOverview` does not retain the broad response or the LAN raw
|
|
73
|
+
payload, because that response can contain network credentials such as the
|
|
74
|
+
Wi-Fi access point key.
|
|
75
|
+
|
|
68
76
|
## Getting started
|
|
69
77
|
|
|
70
78
|
```python
|
|
@@ -79,9 +87,11 @@ async def main() -> None:
|
|
|
79
87
|
async with aiohttp.ClientSession() as session:
|
|
80
88
|
client = DucoClient(session, "192.168.1.10")
|
|
81
89
|
api_info = await client.async_get_api_info()
|
|
90
|
+
info = await client.async_get_info_overview()
|
|
82
91
|
nodes = await client.async_get_nodes_overview()
|
|
83
92
|
|
|
84
93
|
print(api_info.public_api_version)
|
|
94
|
+
print(info.rssi_wifi)
|
|
85
95
|
print([node.node_id for node in nodes])
|
|
86
96
|
|
|
87
97
|
|
|
@@ -97,6 +107,8 @@ public client methods, exports, compatibility aliases, and construction rules.
|
|
|
97
107
|
- `docs/api-reference.md` for the central public API inventory
|
|
98
108
|
- `docs/cli.md` for the function probe CLI and shell examples
|
|
99
109
|
- `docs/config.md` for system, node, and zone config reads and writes
|
|
110
|
+
- `docs/endpoint-inventory.md` for the Public API 2.5 read routes and observed
|
|
111
|
+
response shapes across tested Duco products
|
|
100
112
|
- `docs/live-testing.md` for local opt-in tests against a real Duco device
|
|
101
113
|
- `docs/replay-testing.md` for local sample validation against ignored raw API
|
|
102
114
|
captures
|
|
@@ -62,6 +62,7 @@ from .models import (
|
|
|
62
62
|
InfoGroup,
|
|
63
63
|
InfoGroupStruct,
|
|
64
64
|
InfoModuleSelector,
|
|
65
|
+
InfoOverview,
|
|
65
66
|
InfoZone,
|
|
66
67
|
InfoZoneGroup,
|
|
67
68
|
InfoZonesOverview,
|
|
@@ -183,6 +184,7 @@ __all__ = [
|
|
|
183
184
|
"InfoGroup",
|
|
184
185
|
"InfoGroupStruct",
|
|
185
186
|
"InfoModuleSelector",
|
|
187
|
+
"InfoOverview",
|
|
186
188
|
"InfoZone",
|
|
187
189
|
"InfoZoneGroup",
|
|
188
190
|
"InfoZoneStruct",
|
{python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/cli.py
RENAMED
|
@@ -76,6 +76,9 @@ METHOD_SPECS: dict[str, MethodSpec] = {
|
|
|
76
76
|
description="Return the typed response from /config/zones/{zone}.",
|
|
77
77
|
),
|
|
78
78
|
"async_get_board_info": MethodSpec(description="Return board identity details."),
|
|
79
|
+
"async_get_info_overview": MethodSpec(
|
|
80
|
+
description="Return selected typed values from one unfiltered /info request."
|
|
81
|
+
),
|
|
79
82
|
"async_get_lan_info": MethodSpec(description="Return LAN settings."),
|
|
80
83
|
"async_get_diagnostics_info": MethodSpec(
|
|
81
84
|
description="Return the typed diagnostics response from /info?module=Diag."
|
{python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/client.py
RENAMED
|
@@ -63,6 +63,7 @@ from .models import (
|
|
|
63
63
|
InfoGroup,
|
|
64
64
|
InfoGroupStruct,
|
|
65
65
|
InfoModuleSelector,
|
|
66
|
+
InfoOverview,
|
|
66
67
|
InfoZone,
|
|
67
68
|
InfoZoneGroup,
|
|
68
69
|
InfoZonesOverview,
|
|
@@ -2052,6 +2053,50 @@ class DucoClient:
|
|
|
2052
2053
|
raw_payload=self._preserve_raw_payload(board),
|
|
2053
2054
|
)
|
|
2054
2055
|
|
|
2056
|
+
@classmethod
|
|
2057
|
+
def _parse_info_overview(cls, payload: Any) -> InfoOverview:
|
|
2058
|
+
"""Parse selected values from an unfiltered `/info` payload."""
|
|
2059
|
+
if not isinstance(payload, dict):
|
|
2060
|
+
msg = f"Expected object payload from /info, got {type(payload).__name__}"
|
|
2061
|
+
raise DucoError(msg)
|
|
2062
|
+
|
|
2063
|
+
rssi_wifi = None
|
|
2064
|
+
general = payload.get("General")
|
|
2065
|
+
if general is not None:
|
|
2066
|
+
if not isinstance(general, dict):
|
|
2067
|
+
msg = (
|
|
2068
|
+
"Expected object payload at General in /info response, got "
|
|
2069
|
+
f"{type(general).__name__}"
|
|
2070
|
+
)
|
|
2071
|
+
raise DucoError(msg)
|
|
2072
|
+
lan = general.get("Lan")
|
|
2073
|
+
if lan is not None:
|
|
2074
|
+
if not isinstance(lan, dict):
|
|
2075
|
+
msg = (
|
|
2076
|
+
"Expected object payload at General.Lan in /info response, got "
|
|
2077
|
+
f"{type(lan).__name__}"
|
|
2078
|
+
)
|
|
2079
|
+
raise DucoError(msg)
|
|
2080
|
+
rssi_wifi = cls._read_optional_wrapped_int(
|
|
2081
|
+
lan,
|
|
2082
|
+
"RssiWifi",
|
|
2083
|
+
path="General.Lan",
|
|
2084
|
+
)
|
|
2085
|
+
|
|
2086
|
+
return InfoOverview(
|
|
2087
|
+
rssi_wifi=rssi_wifi,
|
|
2088
|
+
diagnostic_subsystems=cls._parse_diag_info(payload).diagnostic_subsystems,
|
|
2089
|
+
time_filter_remain=cls._parse_time_filter_remaining(payload, request_context="/info"),
|
|
2090
|
+
ventilation_temperatures=cls._parse_ventilation_temperature_info(
|
|
2091
|
+
payload, request_context="/info"
|
|
2092
|
+
),
|
|
2093
|
+
)
|
|
2094
|
+
|
|
2095
|
+
async def async_get_info_overview(self) -> InfoOverview:
|
|
2096
|
+
"""Return selected typed values from one unfiltered `/info` request."""
|
|
2097
|
+
payload = await self._request_json("GET", "/info")
|
|
2098
|
+
return self._parse_info_overview(payload)
|
|
2099
|
+
|
|
2055
2100
|
async def async_get_lan_info(self) -> LanInfo:
|
|
2056
2101
|
"""Return LAN settings reported by the box."""
|
|
2057
2102
|
payload = await self.async_get_info(
|
|
@@ -2258,31 +2303,36 @@ class DucoClient:
|
|
|
2258
2303
|
return None
|
|
2259
2304
|
raise
|
|
2260
2305
|
|
|
2306
|
+
return self._parse_time_filter_remaining(payload)
|
|
2307
|
+
|
|
2308
|
+
@classmethod
|
|
2309
|
+
def _parse_time_filter_remaining(
|
|
2310
|
+
cls,
|
|
2311
|
+
payload: Any,
|
|
2312
|
+
*,
|
|
2313
|
+
request_context: str = "/info?module=HeatRecovery",
|
|
2314
|
+
) -> int | None:
|
|
2315
|
+
"""Parse remaining heat recovery filter time from an info payload."""
|
|
2316
|
+
|
|
2261
2317
|
if not isinstance(payload, dict):
|
|
2262
|
-
msg = (
|
|
2263
|
-
"Expected object payload from /info?module=HeatRecovery, got "
|
|
2264
|
-
f"{type(payload).__name__}"
|
|
2265
|
-
)
|
|
2318
|
+
msg = f"Expected object payload from {request_context}, got {type(payload).__name__}"
|
|
2266
2319
|
raise DucoError(msg)
|
|
2267
2320
|
|
|
2268
2321
|
heat_recovery = payload.get("HeatRecovery")
|
|
2269
2322
|
if heat_recovery is None:
|
|
2270
2323
|
return None
|
|
2271
2324
|
if not isinstance(heat_recovery, dict):
|
|
2272
|
-
msg = "Expected object payload at HeatRecovery in
|
|
2325
|
+
msg = f"Expected object payload at HeatRecovery in {request_context} response"
|
|
2273
2326
|
raise DucoError(msg)
|
|
2274
2327
|
|
|
2275
2328
|
general = heat_recovery.get("General")
|
|
2276
2329
|
if general is None:
|
|
2277
2330
|
return None
|
|
2278
2331
|
if not isinstance(general, dict):
|
|
2279
|
-
msg =
|
|
2280
|
-
"Expected object payload at HeatRecovery.General in "
|
|
2281
|
-
"/info?module=HeatRecovery response"
|
|
2282
|
-
)
|
|
2332
|
+
msg = f"Expected object payload at HeatRecovery.General in {request_context} response"
|
|
2283
2333
|
raise DucoError(msg)
|
|
2284
2334
|
|
|
2285
|
-
return
|
|
2335
|
+
return cls._read_optional_wrapped_int(
|
|
2286
2336
|
general,
|
|
2287
2337
|
"TimeFilterRemain",
|
|
2288
2338
|
path="HeatRecovery.General",
|
|
@@ -2297,40 +2347,46 @@ class DucoClient:
|
|
|
2297
2347
|
return VentilationTemperatureInfo()
|
|
2298
2348
|
raise
|
|
2299
2349
|
|
|
2350
|
+
return self._parse_ventilation_temperature_info(payload)
|
|
2351
|
+
|
|
2352
|
+
@classmethod
|
|
2353
|
+
def _parse_ventilation_temperature_info(
|
|
2354
|
+
cls,
|
|
2355
|
+
payload: Any,
|
|
2356
|
+
*,
|
|
2357
|
+
request_context: str = "/info?module=Ventilation",
|
|
2358
|
+
) -> VentilationTemperatureInfo:
|
|
2359
|
+
"""Parse ventilation temperatures from an info payload."""
|
|
2360
|
+
|
|
2300
2361
|
if not isinstance(payload, dict):
|
|
2301
|
-
msg = (
|
|
2302
|
-
"Expected object payload from /info?module=Ventilation, got "
|
|
2303
|
-
f"{type(payload).__name__}"
|
|
2304
|
-
)
|
|
2362
|
+
msg = f"Expected object payload from {request_context}, got {type(payload).__name__}"
|
|
2305
2363
|
raise DucoError(msg)
|
|
2306
2364
|
|
|
2307
2365
|
ventilation = payload.get("Ventilation")
|
|
2308
2366
|
if ventilation is None:
|
|
2309
2367
|
return VentilationTemperatureInfo()
|
|
2310
2368
|
if not isinstance(ventilation, dict):
|
|
2311
|
-
msg = "Expected object payload at Ventilation in
|
|
2369
|
+
msg = f"Expected object payload at Ventilation in {request_context} response"
|
|
2312
2370
|
raise DucoError(msg)
|
|
2313
2371
|
|
|
2314
2372
|
sensor = ventilation.get("Sensor")
|
|
2315
2373
|
if sensor is None:
|
|
2316
|
-
return VentilationTemperatureInfo(raw_payload=
|
|
2374
|
+
return VentilationTemperatureInfo(raw_payload=cls._preserve_raw_payload(ventilation))
|
|
2317
2375
|
if not isinstance(sensor, dict):
|
|
2318
|
-
msg =
|
|
2319
|
-
"Expected object payload at Ventilation.Sensor in /info?module=Ventilation response"
|
|
2320
|
-
)
|
|
2376
|
+
msg = f"Expected object payload at Ventilation.Sensor in {request_context} response"
|
|
2321
2377
|
raise DucoError(msg)
|
|
2322
2378
|
|
|
2323
|
-
temp_oda =
|
|
2324
|
-
temp_sup =
|
|
2325
|
-
temp_eta =
|
|
2326
|
-
temp_eha =
|
|
2379
|
+
temp_oda = cls._read_optional_wrapped_int(sensor, "TempOda", path="Ventilation.Sensor")
|
|
2380
|
+
temp_sup = cls._read_optional_wrapped_int(sensor, "TempSup", path="Ventilation.Sensor")
|
|
2381
|
+
temp_eta = cls._read_optional_wrapped_int(sensor, "TempEta", path="Ventilation.Sensor")
|
|
2382
|
+
temp_eha = cls._read_optional_wrapped_int(sensor, "TempEha", path="Ventilation.Sensor")
|
|
2327
2383
|
|
|
2328
2384
|
return VentilationTemperatureInfo(
|
|
2329
|
-
temp_oda=None if temp_oda is None else
|
|
2330
|
-
temp_sup=None if temp_sup is None else
|
|
2331
|
-
temp_eta=None if temp_eta is None else
|
|
2332
|
-
temp_eha=None if temp_eha is None else
|
|
2333
|
-
raw_payload=
|
|
2385
|
+
temp_oda=None if temp_oda is None else cls._decicelsius_to_celsius(temp_oda),
|
|
2386
|
+
temp_sup=None if temp_sup is None else cls._decicelsius_to_celsius(temp_sup),
|
|
2387
|
+
temp_eta=None if temp_eta is None else cls._decicelsius_to_celsius(temp_eta),
|
|
2388
|
+
temp_eha=None if temp_eha is None else cls._decicelsius_to_celsius(temp_eha),
|
|
2389
|
+
raw_payload=cls._preserve_raw_payload(sensor),
|
|
2334
2390
|
)
|
|
2335
2391
|
|
|
2336
2392
|
async def async_get_bypass_supply_temperature_target(
|
{python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/models.py
RENAMED
|
@@ -1676,6 +1676,18 @@ class DiagInfo:
|
|
|
1676
1676
|
raw_payload: dict[str, Any] = field(default_factory=dict, repr=False, compare=False)
|
|
1677
1677
|
|
|
1678
1678
|
|
|
1679
|
+
@dataclass(frozen=True, slots=True)
|
|
1680
|
+
class InfoOverview:
|
|
1681
|
+
"""Selected typed values returned by an unfiltered `/info` request."""
|
|
1682
|
+
|
|
1683
|
+
rssi_wifi: int | None = None
|
|
1684
|
+
diagnostic_subsystems: tuple[DiagComponent, ...] = ()
|
|
1685
|
+
time_filter_remain: int | None = None
|
|
1686
|
+
ventilation_temperatures: VentilationTemperatureInfo = field(
|
|
1687
|
+
default_factory=VentilationTemperatureInfo
|
|
1688
|
+
)
|
|
1689
|
+
|
|
1690
|
+
|
|
1679
1691
|
@dataclass(frozen=True, slots=True, init=False)
|
|
1680
1692
|
class Action:
|
|
1681
1693
|
"""System action request payload."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-duco-connectivity
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.16.0
|
|
4
4
|
Summary: Async HTTP client for the local Duco Connectivity API
|
|
5
5
|
Author: Ronald van der Meer
|
|
6
6
|
License-Expression: MIT
|
|
@@ -64,6 +64,7 @@ in the development examples below.
|
|
|
64
64
|
- asynchronous communication via `aiohttp`
|
|
65
65
|
- typed stable config families for the documented `/config` branches
|
|
66
66
|
- typed helpers for stable `/info` fields such as heat recovery filter time
|
|
67
|
+
- a typed overview for selected values from one unfiltered `/info` request
|
|
67
68
|
- natural empty results for optional capability discovery and explicit errors
|
|
68
69
|
for strict capability access
|
|
69
70
|
- typed models that stay close to the API response shape
|
|
@@ -97,6 +98,13 @@ pre-0.13 raw status string remains compatible and derives `raw_status`
|
|
|
97
98
|
automatically; callers using a normalized `DiagStatus` must provide
|
|
98
99
|
`raw_status` explicitly.
|
|
99
100
|
|
|
101
|
+
`async_get_info_overview()` combines RSSI, diagnostic subsystems, heat recovery
|
|
102
|
+
filter time, and ventilation temperatures from one `GET /info` request. Missing
|
|
103
|
+
product-specific modules produce their natural empty values. Unlike most typed
|
|
104
|
+
models, `InfoOverview` does not retain the broad response or the LAN raw
|
|
105
|
+
payload, because that response can contain network credentials such as the
|
|
106
|
+
Wi-Fi access point key.
|
|
107
|
+
|
|
100
108
|
## Getting started
|
|
101
109
|
|
|
102
110
|
```python
|
|
@@ -111,9 +119,11 @@ async def main() -> None:
|
|
|
111
119
|
async with aiohttp.ClientSession() as session:
|
|
112
120
|
client = DucoClient(session, "192.168.1.10")
|
|
113
121
|
api_info = await client.async_get_api_info()
|
|
122
|
+
info = await client.async_get_info_overview()
|
|
114
123
|
nodes = await client.async_get_nodes_overview()
|
|
115
124
|
|
|
116
125
|
print(api_info.public_api_version)
|
|
126
|
+
print(info.rssi_wifi)
|
|
117
127
|
print([node.node_id for node in nodes])
|
|
118
128
|
|
|
119
129
|
|
|
@@ -129,6 +139,8 @@ public client methods, exports, compatibility aliases, and construction rules.
|
|
|
129
139
|
- `docs/api-reference.md` for the central public API inventory
|
|
130
140
|
- `docs/cli.md` for the function probe CLI and shell examples
|
|
131
141
|
- `docs/config.md` for system, node, and zone config reads and writes
|
|
142
|
+
- `docs/endpoint-inventory.md` for the Public API 2.5 read routes and observed
|
|
143
|
+
response shapes across tested Duco products
|
|
132
144
|
- `docs/live-testing.md` for local opt-in tests against a real Duco device
|
|
133
145
|
- `docs/replay-testing.md` for local sample validation against ignored raw API
|
|
134
146
|
captures
|
|
@@ -55,6 +55,7 @@ from duco_connectivity import (
|
|
|
55
55
|
InfoGeneralSubmoduleSelector,
|
|
56
56
|
InfoGroup,
|
|
57
57
|
InfoModuleSelector,
|
|
58
|
+
InfoOverview,
|
|
58
59
|
InfoZone,
|
|
59
60
|
InfoZoneGroup,
|
|
60
61
|
InfoZonesOverview,
|
|
@@ -2004,6 +2005,127 @@ async def test_lan_info_wifi_is_parsed(lan_info_data: dict[str, object]) -> None
|
|
|
2004
2005
|
assert lan.raw_payload is lan_info_data["General"]["Lan"]
|
|
2005
2006
|
|
|
2006
2007
|
|
|
2008
|
+
async def test_info_overview_parses_supported_data_without_sensitive_raw_payload(
|
|
2009
|
+
generic_info_all_data: dict[str, object],
|
|
2010
|
+
) -> None:
|
|
2011
|
+
"""The broad info overview should expose only its typed public contract."""
|
|
2012
|
+
mock_response = _response(json_payload=generic_info_all_data)
|
|
2013
|
+
|
|
2014
|
+
async with aiohttp.ClientSession() as session:
|
|
2015
|
+
client = DucoClient(session=session, host="192.0.2.94")
|
|
2016
|
+
with patch.object(session, "request", _request(mock_response)) as request_mock:
|
|
2017
|
+
overview = await client.async_get_info_overview()
|
|
2018
|
+
|
|
2019
|
+
assert isinstance(overview, InfoOverview)
|
|
2020
|
+
assert_type(overview, InfoOverview)
|
|
2021
|
+
assert overview.rssi_wifi == -47
|
|
2022
|
+
assert tuple(subsystem.component for subsystem in overview.diagnostic_subsystems) == (
|
|
2023
|
+
"Ventilation",
|
|
2024
|
+
"VentCool",
|
|
2025
|
+
"SunCtrl",
|
|
2026
|
+
)
|
|
2027
|
+
assert overview.time_filter_remain is None
|
|
2028
|
+
assert overview.ventilation_temperatures == VentilationTemperatureInfo()
|
|
2029
|
+
assert not hasattr(overview, "raw_payload")
|
|
2030
|
+
assert request_mock.call_args.args == ("GET", "http://192.0.2.94/info")
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
async def test_info_overview_parses_energy_modules() -> None:
|
|
2034
|
+
"""The broad info overview should combine all supported ENERGY data."""
|
|
2035
|
+
payload: dict[str, object] = {
|
|
2036
|
+
"General": {
|
|
2037
|
+
"Lan": {
|
|
2038
|
+
"WifiApKey": {"Val": "secret"},
|
|
2039
|
+
"RssiWifi": {"Val": -51},
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
"Diag": {
|
|
2043
|
+
"SubSystems": [
|
|
2044
|
+
{"Component": "Ventilation", "Status": "Ok"},
|
|
2045
|
+
]
|
|
2046
|
+
},
|
|
2047
|
+
"HeatRecovery": {
|
|
2048
|
+
"General": {"TimeFilterRemain": {"Val": 7200}},
|
|
2049
|
+
},
|
|
2050
|
+
"Ventilation": {
|
|
2051
|
+
"Sensor": {
|
|
2052
|
+
"TempOda": {"Val": 175},
|
|
2053
|
+
"TempSup": {"Val": 180},
|
|
2054
|
+
"TempEta": {"Val": 215},
|
|
2055
|
+
"TempEha": {"Val": 225},
|
|
2056
|
+
}
|
|
2057
|
+
},
|
|
2058
|
+
}
|
|
2059
|
+
mock_response = _response(json_payload=payload)
|
|
2060
|
+
|
|
2061
|
+
async with aiohttp.ClientSession() as session:
|
|
2062
|
+
client = DucoClient(session=session, host="192.0.2.94")
|
|
2063
|
+
with patch.object(session, "request", _request(mock_response)):
|
|
2064
|
+
overview = await client.async_get_info_overview()
|
|
2065
|
+
|
|
2066
|
+
assert overview.rssi_wifi == -51
|
|
2067
|
+
assert overview.diagnostic_subsystems[0].status is DiagStatus.OK
|
|
2068
|
+
assert overview.time_filter_remain == 7200
|
|
2069
|
+
assert overview.ventilation_temperatures == VentilationTemperatureInfo(
|
|
2070
|
+
temp_oda=17.5,
|
|
2071
|
+
temp_sup=18.0,
|
|
2072
|
+
temp_eta=21.5,
|
|
2073
|
+
temp_eha=22.5,
|
|
2074
|
+
)
|
|
2075
|
+
assert "WifiApKey" not in repr(overview)
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
@pytest.mark.parametrize(
|
|
2079
|
+
("payload", "message"),
|
|
2080
|
+
[
|
|
2081
|
+
pytest.param(
|
|
2082
|
+
[],
|
|
2083
|
+
"Expected object payload from /info, got list",
|
|
2084
|
+
id="top-level",
|
|
2085
|
+
),
|
|
2086
|
+
pytest.param(
|
|
2087
|
+
{"General": []},
|
|
2088
|
+
"Expected object payload at General in /info response, got list",
|
|
2089
|
+
id="general",
|
|
2090
|
+
),
|
|
2091
|
+
pytest.param(
|
|
2092
|
+
{"General": {"Lan": []}},
|
|
2093
|
+
"Expected object payload at General.Lan in /info response, got list",
|
|
2094
|
+
id="lan",
|
|
2095
|
+
),
|
|
2096
|
+
pytest.param(
|
|
2097
|
+
{"General": {"Lan": {"RssiWifi": {"Val": "strong"}}}},
|
|
2098
|
+
"Expected integer value for General.Lan.RssiWifi, got str",
|
|
2099
|
+
id="rssi",
|
|
2100
|
+
),
|
|
2101
|
+
pytest.param(
|
|
2102
|
+
{"HeatRecovery": []},
|
|
2103
|
+
"Expected object payload at HeatRecovery in /info response",
|
|
2104
|
+
id="heat-recovery",
|
|
2105
|
+
),
|
|
2106
|
+
pytest.param(
|
|
2107
|
+
{"Ventilation": []},
|
|
2108
|
+
"Expected object payload at Ventilation in /info response",
|
|
2109
|
+
id="ventilation",
|
|
2110
|
+
),
|
|
2111
|
+
],
|
|
2112
|
+
)
|
|
2113
|
+
async def test_info_overview_rejects_malformed_payloads(
|
|
2114
|
+
payload: object,
|
|
2115
|
+
message: str,
|
|
2116
|
+
) -> None:
|
|
2117
|
+
"""Present malformed overview sections should fail with field context."""
|
|
2118
|
+
mock_response = _response(json_payload=payload)
|
|
2119
|
+
|
|
2120
|
+
async with aiohttp.ClientSession() as session:
|
|
2121
|
+
client = DucoClient(session=session, host="192.0.2.94")
|
|
2122
|
+
with (
|
|
2123
|
+
patch.object(session, "request", _request(mock_response)),
|
|
2124
|
+
pytest.raises(DucoError, match=re.escape(message)),
|
|
2125
|
+
):
|
|
2126
|
+
await client.async_get_info_overview()
|
|
2127
|
+
|
|
2128
|
+
|
|
2007
2129
|
async def test_lan_info_ethernet_is_parsed(
|
|
2008
2130
|
lan_info_ethernet_data: dict[str, object],
|
|
2009
2131
|
) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/src/duco_connectivity/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_api_reference.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_duco_connectivity-0.15.0 → python_duco_connectivity-0.16.0}/tests/test_replay_helpers.py
RENAMED
|
File without changes
|