python-duco-connectivity 0.10.0__tar.gz → 0.11.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.10.0/src/python_duco_connectivity.egg-info → python_duco_connectivity-0.11.0}/PKG-INFO +4 -3
  2. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/README.md +3 -2
  3. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/pyproject.toml +1 -1
  4. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/duco_connectivity/client.py +6 -2
  5. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0/src/python_duco_connectivity.egg-info}/PKG-INFO +4 -3
  6. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/tests/test_api_reference.py +1 -1
  7. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/tests/test_client.py +10 -6
  8. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/LICENSE +0 -0
  9. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/setup.cfg +0 -0
  10. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/duco_connectivity/__init__.py +0 -0
  11. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/duco_connectivity/__main__.py +0 -0
  12. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/duco_connectivity/cli.py +0 -0
  13. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/duco_connectivity/exceptions.py +0 -0
  14. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/duco_connectivity/models.py +0 -0
  15. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/duco_connectivity/py.typed +0 -0
  16. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/python_duco_connectivity.egg-info/SOURCES.txt +0 -0
  17. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/python_duco_connectivity.egg-info/dependency_links.txt +0 -0
  18. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/python_duco_connectivity.egg-info/entry_points.txt +0 -0
  19. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/python_duco_connectivity.egg-info/requires.txt +0 -0
  20. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/src/python_duco_connectivity.egg-info/top_level.txt +0 -0
  21. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/tests/test_cli.py +0 -0
  22. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/tests/test_exceptions.py +0 -0
  23. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/tests/test_local_sample_validation.py +0 -0
  24. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/tests/test_models.py +0 -0
  25. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.0}/tests/test_pytest_live_support.py +0 -0
  26. {python_duco_connectivity-0.10.0 → python_duco_connectivity-0.11.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.10.0
3
+ Version: 0.11.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
@@ -76,8 +76,9 @@ bypass-target endpoint is unsupported, the relevant helper raises
76
76
  subclass and preserves the HTTP status, path, and response body. A valid
77
77
  ventilation-temperature response always returns a `VentilationTemperatureInfo`
78
78
  model, whose individual temperature fields can be `None` when omitted. The
79
- bypass-target helper returns `None` when its target is omitted from a valid
80
- response.
79
+ bypass-target helper returns a typed target model for successful parameter-
80
+ specific reads and raises `DucoError` if the requested target field is missing
81
+ from an otherwise valid `/config` response.
81
82
 
82
83
  Diagnostic subsystem reads now keep raw component and status strings from
83
84
  `Diag.SubSystems`, so future subsystem names or status values remain available
@@ -44,8 +44,9 @@ bypass-target endpoint is unsupported, the relevant helper raises
44
44
  subclass and preserves the HTTP status, path, and response body. A valid
45
45
  ventilation-temperature response always returns a `VentilationTemperatureInfo`
46
46
  model, whose individual temperature fields can be `None` when omitted. The
47
- bypass-target helper returns `None` when its target is omitted from a valid
48
- response.
47
+ bypass-target helper returns a typed target model for successful parameter-
48
+ specific reads and raises `DucoError` if the requested target field is missing
49
+ from an otherwise valid `/config` response.
49
50
 
50
51
  Diagnostic subsystem reads now keep raw component and status strings from
51
52
  `Diag.SubSystems`, so future subsystem names or status values remain available
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-duco-connectivity"
7
- version = "0.10.0"
7
+ version = "0.11.0"
8
8
  description = "Async HTTP client for the local Duco Connectivity API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -2295,7 +2295,7 @@ class DucoClient:
2295
2295
  async def async_get_bypass_supply_temperature_target(
2296
2296
  self,
2297
2297
  zone_id: int,
2298
- ) -> BypassSupplyTemperatureTarget | None:
2298
+ ) -> BypassSupplyTemperatureTarget:
2299
2299
  """Return a bypass supply target from `/config` in Celsius."""
2300
2300
  parameter = self._validate_bypass_zone_id(zone_id)
2301
2301
  try:
@@ -2312,7 +2312,11 @@ class DucoClient:
2312
2312
  err.body,
2313
2313
  ) from err
2314
2314
  raise
2315
- return self._extract_bypass_supply_temperature_target(config, zone_id)
2315
+ target = self._extract_bypass_supply_temperature_target(config, zone_id)
2316
+ if target is None:
2317
+ msg = f"Expected {parameter} in /config response"
2318
+ raise DucoError(msg)
2319
+ return target
2316
2320
 
2317
2321
  async def async_set_bypass_supply_temperature_target(
2318
2322
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-duco-connectivity
3
- Version: 0.10.0
3
+ Version: 0.11.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
@@ -76,8 +76,9 @@ bypass-target endpoint is unsupported, the relevant helper raises
76
76
  subclass and preserves the HTTP status, path, and response body. A valid
77
77
  ventilation-temperature response always returns a `VentilationTemperatureInfo`
78
78
  model, whose individual temperature fields can be `None` when omitted. The
79
- bypass-target helper returns `None` when its target is omitted from a valid
80
- response.
79
+ bypass-target helper returns a typed target model for successful parameter-
80
+ specific reads and raises `DucoError` if the requested target field is missing
81
+ from an otherwise valid `/config` response.
81
82
 
82
83
  Diagnostic subsystem reads now keep raw component and status strings from
83
84
  `Diag.SubSystems`, so future subsystem names or status values remain available
@@ -90,7 +90,7 @@ def test_api_reference_documents_optional_capability_contracts() -> None:
90
90
  content = render_api_reference()
91
91
 
92
92
  assert "optional endpoint as unsupported" in content
93
- assert "target is omitted from an otherwise valid response" in content
93
+ assert "without the requested target field in the response" in content
94
94
  assert "optional target endpoint is unsupported" in content
95
95
 
96
96
 
@@ -3794,16 +3794,20 @@ async def test_get_bypass_supply_temperature_target_returns_converted_values(
3794
3794
  }
3795
3795
 
3796
3796
 
3797
- async def test_get_bypass_supply_temperature_target_returns_none_when_not_reported() -> None:
3798
- """Missing bypass targets should return None instead of failing."""
3797
+ async def test_get_bypass_supply_temperature_target_raises_when_not_reported() -> None:
3798
+ """Missing bypass targets should fail for parameter-specific helper reads."""
3799
3799
  mock_response = _response(json_payload={"HeatRecovery": {"Bypass": {}}})
3800
3800
 
3801
3801
  async with aiohttp.ClientSession() as session:
3802
3802
  client = DucoClient(session=session, host="192.0.2.94")
3803
- with patch.object(session, "request", _request(mock_response)):
3804
- payload = await client.async_get_bypass_supply_temperature_target(1)
3805
-
3806
- assert payload is None
3803
+ with (
3804
+ patch.object(session, "request", _request(mock_response)),
3805
+ pytest.raises(
3806
+ DucoError,
3807
+ match=re.escape("Expected TempSupTgtZone1 in /config response"),
3808
+ ),
3809
+ ):
3810
+ await client.async_get_bypass_supply_temperature_target(1)
3807
3811
 
3808
3812
 
3809
3813
  async def test_get_bypass_supply_temperature_target_raises_when_unsupported() -> None: