python-duco-connectivity 0.14.0__tar.gz → 0.15.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.
Files changed (26) hide show
  1. {python_duco_connectivity-0.14.0/src/python_duco_connectivity.egg-info → python_duco_connectivity-0.15.0}/PKG-INFO +2 -3
  2. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/README.md +1 -2
  3. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/pyproject.toml +1 -1
  4. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/duco_connectivity/client.py +7 -8
  5. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0/src/python_duco_connectivity.egg-info}/PKG-INFO +2 -3
  6. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/tests/test_client.py +19 -50
  7. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/LICENSE +0 -0
  8. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/setup.cfg +0 -0
  9. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/duco_connectivity/__init__.py +0 -0
  10. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/duco_connectivity/__main__.py +0 -0
  11. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/duco_connectivity/cli.py +0 -0
  12. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/duco_connectivity/exceptions.py +0 -0
  13. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/duco_connectivity/models.py +0 -0
  14. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/duco_connectivity/py.typed +0 -0
  15. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/python_duco_connectivity.egg-info/SOURCES.txt +0 -0
  16. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/python_duco_connectivity.egg-info/dependency_links.txt +0 -0
  17. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/python_duco_connectivity.egg-info/entry_points.txt +0 -0
  18. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/python_duco_connectivity.egg-info/requires.txt +0 -0
  19. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/src/python_duco_connectivity.egg-info/top_level.txt +0 -0
  20. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/tests/test_api_reference.py +0 -0
  21. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/tests/test_cli.py +0 -0
  22. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/tests/test_exceptions.py +0 -0
  23. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/tests/test_local_sample_validation.py +0 -0
  24. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/tests/test_models.py +0 -0
  25. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.0}/tests/test_pytest_live_support.py +0 -0
  26. {python_duco_connectivity-0.14.0 → python_duco_connectivity-0.15.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.14.0
3
+ Version: 0.15.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
@@ -86,8 +86,7 @@ or inconsistent. `BypassSupplyTemperatureTarget.validate_value()` checks a
86
86
  Celsius value against the target-specific range and step, while
87
87
  `normalize_value()` rounds converted values to the nearest supported step. Pass
88
88
  the target to `async_set_bypass_supply_temperature_target(..., target=target)`
89
- to validate a write without an additional read. Calls without `target` retain
90
- the legacy finite and exact-decicelsius validation temporarily.
89
+ to validate a write without an additional read.
91
90
 
92
91
  Diagnostic subsystem reads expose known status values as normalized `DiagStatus`
93
92
  members (`ok`, `disabled`, or `error`). Each `DiagComponent` also keeps the exact
@@ -54,8 +54,7 @@ or inconsistent. `BypassSupplyTemperatureTarget.validate_value()` checks a
54
54
  Celsius value against the target-specific range and step, while
55
55
  `normalize_value()` rounds converted values to the nearest supported step. Pass
56
56
  the target to `async_set_bypass_supply_temperature_target(..., target=target)`
57
- to validate a write without an additional read. Calls without `target` retain
58
- the legacy finite and exact-decicelsius validation temporarily.
57
+ to validate a write without an additional read.
59
58
 
60
59
  Diagnostic subsystem reads expose known status values as normalized `DiagStatus`
61
60
  members (`ok`, `disabled`, or `error`). Each `DiagComponent` also keeps the exact
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-duco-connectivity"
7
- version = "0.14.0"
7
+ version = "0.15.0"
8
8
  description = "Async HTTP client for the local Duco Connectivity API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -2379,14 +2379,13 @@ class DucoClient:
2379
2379
  zone_id: int,
2380
2380
  temperature: float,
2381
2381
  *,
2382
- target: BypassSupplyTemperatureTarget | None = None,
2382
+ target: BypassSupplyTemperatureTarget,
2383
2383
  ) -> BypassSupplyTemperatureTarget:
2384
2384
  """Set a bypass supply target through `/config` using Celsius input."""
2385
2385
  parameter = self._validate_bypass_zone_id(zone_id)
2386
- if target is not None:
2387
- if target.zone_id != zone_id:
2388
- raise ValueError("target zone_id must match zone_id")
2389
- target.validate_value(temperature)
2386
+ if target.zone_id != zone_id:
2387
+ raise ValueError("target zone_id must match zone_id")
2388
+ target.validate_value(temperature)
2390
2389
  raw_value = self._celsius_to_decicelsius(
2391
2390
  temperature,
2392
2391
  path=f"bypass_supply_temperature_target[{zone_id}]",
@@ -2397,11 +2396,11 @@ class DucoClient:
2397
2396
  submodule=ConfigHeatRecoverySubmoduleSelector.BYPASS,
2398
2397
  parameter=parameter,
2399
2398
  )
2400
- target = self._extract_bypass_supply_temperature_target(response, zone_id)
2401
- if target is None:
2399
+ updated_target = self._extract_bypass_supply_temperature_target(response, zone_id)
2400
+ if updated_target is None:
2402
2401
  msg = f"Expected {parameter} in /config response after bypass target write"
2403
2402
  raise DucoError(msg)
2404
- return target
2403
+ return updated_target
2405
2404
 
2406
2405
  async def async_get_write_req_remaining(self) -> int:
2407
2406
  """Backward-compatible alias for the old write budget method name."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-duco-connectivity
3
- Version: 0.14.0
3
+ Version: 0.15.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
@@ -86,8 +86,7 @@ or inconsistent. `BypassSupplyTemperatureTarget.validate_value()` checks a
86
86
  Celsius value against the target-specific range and step, while
87
87
  `normalize_value()` rounds converted values to the nearest supported step. Pass
88
88
  the target to `async_set_bypass_supply_temperature_target(..., target=target)`
89
- to validate a write without an additional read. Calls without `target` retain
90
- the legacy finite and exact-decicelsius validation temporarily.
89
+ to validate a write without an additional read.
91
90
 
92
91
  Diagnostic subsystem reads expose known status values as normalized `DiagStatus`
93
92
  members (`ok`, `disabled`, or `error`). Each `DiagComponent` also keeps the exact
@@ -4042,37 +4042,13 @@ async def test_bypass_supply_temperature_helpers_reject_invalid_zone_ids(zone_id
4042
4042
  with pytest.raises(ValueError, match="zone_id must be an integer between 1 and 8"):
4043
4043
  await client.async_get_bypass_supply_temperature_target(cast(Any, zone_id))
4044
4044
 
4045
+ dummy_target = BypassSupplyTemperatureTarget(
4046
+ zone_id=1, value=18.0, minimum=12.0, increment=0.5, maximum=22.0
4047
+ )
4045
4048
  with pytest.raises(ValueError, match="zone_id must be an integer between 1 and 8"):
4046
- await client.async_set_bypass_supply_temperature_target(cast(Any, zone_id), 18.0)
4047
-
4048
-
4049
- async def test_set_bypass_supply_temperature_target_serializes_decicelsius(
4050
- config_data: dict[str, object],
4051
- ) -> None:
4052
- """Bypass target helpers should serialize Celsius writes as raw decicelsius values."""
4053
- mock_response = _response(json_payload=config_data)
4054
-
4055
- async with aiohttp.ClientSession() as session:
4056
- client = DucoClient(session=session, host="192.0.2.94")
4057
- request = MagicMock(return_value=_request_context(mock_response))
4058
- with patch.object(session, "request", request):
4059
- payload = await client.async_set_bypass_supply_temperature_target(2, 18.5)
4060
-
4061
- assert payload == BypassSupplyTemperatureTarget(
4062
- zone_id=2,
4063
- value=18.5,
4064
- minimum=12.0,
4065
- increment=0.5,
4066
- maximum=22.0,
4067
- )
4068
- _, kwargs = request.call_args
4069
- assert kwargs["params"] == {
4070
- "module": "HeatRecovery",
4071
- "submodule": "Bypass",
4072
- "parameter": "TempSupTgtZone2",
4073
- }
4074
- assert kwargs["data"] == b'{"HeatRecovery":{"Bypass":{"TempSupTgtZone2":{"Val":185}}}}'
4075
- assert kwargs["headers"] == {"Content-Type": "application/json"}
4049
+ await client.async_set_bypass_supply_temperature_target(
4050
+ cast(Any, zone_id), 18.0, target=dummy_target
4051
+ )
4076
4052
 
4077
4053
 
4078
4054
  async def test_set_bypass_supply_temperature_target_validates_against_target(
@@ -4160,30 +4136,23 @@ async def test_set_bypass_supply_temperature_target_rejects_invalid_response() -
4160
4136
 
4161
4137
  async with aiohttp.ClientSession() as session:
4162
4138
  client = DucoClient(session=session, host="192.0.2.94")
4139
+ valid_target = BypassSupplyTemperatureTarget(
4140
+ zone_id=1, value=18.0, minimum=12.0, increment=0.5, maximum=22.0
4141
+ )
4142
+ mock_request = _request(mock_response)
4163
4143
  with (
4164
- patch.object(session, "request", _request(mock_response)),
4144
+ patch.object(session, "request", mock_request),
4165
4145
  pytest.raises(DucoError, match="Invalid TempSupTgtZone1: missing Max"),
4166
4146
  ):
4167
- await client.async_set_bypass_supply_temperature_target(1, 18.0)
4168
-
4147
+ await client.async_set_bypass_supply_temperature_target(1, 18.0, target=valid_target)
4169
4148
 
4170
- @pytest.mark.parametrize(
4171
- ("value", "message"),
4172
- [
4173
- pytest.param(18.34, "must be representable in 0.1°C increments", id="not_decicelsius"),
4174
- pytest.param(float("inf"), "must be a finite temperature value", id="not_finite"),
4175
- pytest.param(True, "must be an int or float, got bool", id="bool"),
4176
- ],
4177
- )
4178
- async def test_set_bypass_supply_temperature_target_rejects_invalid_temperatures(
4179
- value: object,
4180
- message: str,
4181
- ) -> None:
4182
- """Invalid convenience write values should fail before a request is sent."""
4183
- async with aiohttp.ClientSession() as session:
4184
- client = DucoClient(session=session, host="192.0.2.94")
4185
- with pytest.raises(ValueError, match=re.escape(message)):
4186
- await client.async_set_bypass_supply_temperature_target(1, cast(Any, value))
4149
+ _, kwargs = mock_request.call_args
4150
+ assert kwargs["params"] == {
4151
+ "module": "HeatRecovery",
4152
+ "submodule": "Bypass",
4153
+ "parameter": "TempSupTgtZone1",
4154
+ }
4155
+ assert kwargs["data"] == b'{"HeatRecovery":{"Bypass":{"TempSupTgtZone1":{"Val":180}}}}'
4187
4156
 
4188
4157
 
4189
4158
  async def test_get_write_requests_remaining_is_parsed() -> None: