python-bsblan 6.1.2__tar.gz → 6.1.3__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_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/release.yaml +1 -1
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/tests.yaml +1 -1
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/PKG-INFO +1 -1
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/package-lock.json +4 -4
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/package.json +1 -1
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/pyproject.toml +3 -3
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/bsblan.py +16 -2
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_circuit.py +77 -1
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_pps.py +10 -2
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.editorconfig +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.gitattributes +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/CODE_OF_CONDUCT.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/CONTRIBUTING.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/ISSUE_TEMPLATE/PULL_REQUEST_TEMPLATE.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/SECURITY.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/agents/pr-review.agent.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/agents/security-reviewer.agent.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/agents/tdd-refactor.agent.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/copilot-instructions.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/hooks/run-validation-after-edits.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/hooks/run_validation_after_edits.sh +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/labels.yml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/prompts/add-parameter.prompt.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/prompts/code-review.prompt.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/release-drafter.yml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/renovate.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/skills/bsblan-parameters/SKILL.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/skills/bsblan-testing/SKILL.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/skills/feature-doc-updates/SKILL.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/auto-approve-renovate.yml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/codeql.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/dependency-review.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/docs.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/labels.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/linting.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/lock.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/pr-labels.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/release-drafter.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/scorecard.yml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/stale.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/workflows/typing.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.github/zizmor.yml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.gitignore +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.nvmrc +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.pre-commit-config.yaml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.prettierignore +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/.yamllint +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/AGENTS.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/CLAUDE.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/LICENSE.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/Makefile +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/README.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/docs/api/client.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/docs/api/constants.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/docs/api/exceptions.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/docs/api/models.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/docs/getting-started.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/docs/index.md +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/examples/control.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/examples/discovery.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/examples/fetch_param.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/examples/profile_init.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/examples/ruff.toml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/examples/speed_test.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/mkdocs.yml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/sonar-project.properties +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/__init__.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/_temperature.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/_transport.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/_validation.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/_version.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/constants.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/exceptions.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/models.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/py.typed +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/src/bsblan/utility.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/__init__.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/conftest.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/device.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/dict_version.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/hot_water_state.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/info.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/password.txt +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/pps_device.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/pps_state.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/pps_static_values.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/sensor.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/state.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/state_circuit2.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/static_state.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/static_state_circuit2.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/thermostat_hvac.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/thermostat_temp.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/fixtures/time.json +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/ruff.toml +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_api_initialization.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_api_validation.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_auth.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_backoff_retry.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_bsblan.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_bsblan_edge_cases.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_configuration.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_constants.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_context_manager.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_device.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_dhw_time_switch.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_entity_info.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_entity_info_ha.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_heating_schedule.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_hot_water_additional.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_hotwater_state.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_include_parameter.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_info.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_initialization.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_read_parameters.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_reset_validation.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_schedule_models.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_sensor.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_set_heating_schedule.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_set_hot_water_schedule.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_set_hotwater.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_state.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_static_state.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_temperature_unit.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_temperature_validation.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_thermostat.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_time.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_utility.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_utility_additional.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_utility_edge_cases.py +0 -0
- {python_bsblan-6.1.2 → python_bsblan-6.1.3}/tests/test_version_errors.py +0 -0
|
@@ -59,7 +59,7 @@ jobs:
|
|
|
59
59
|
verbose: true
|
|
60
60
|
print-hash: true
|
|
61
61
|
- name: ✍️ Sign published artifacts
|
|
62
|
-
uses: sigstore/gh-action-sigstore-python@
|
|
62
|
+
uses: sigstore/gh-action-sigstore-python@5b79a39c381910c090341a2c9b0bf022c8b387e1 # v3.4.0
|
|
63
63
|
with:
|
|
64
64
|
inputs: ./dist/*.tar.gz ./dist/*.whl
|
|
65
65
|
release-signing-artifacts: false
|
|
@@ -101,7 +101,7 @@ jobs:
|
|
|
101
101
|
- name: SonarQube Cloud Scan
|
|
102
102
|
if: env.HAS_SONAR_TOKEN == 'true' && (github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork)
|
|
103
103
|
# yamllint disable-line rule:line-length
|
|
104
|
-
uses: SonarSource/sonarqube-scan-action@
|
|
104
|
+
uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2
|
|
105
105
|
env:
|
|
106
106
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
107
107
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"url-parse": "1.5.10"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"prettier": "3.8.
|
|
15
|
+
"prettier": "3.8.4"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"node_modules/prettier": {
|
|
19
|
-
"version": "3.8.
|
|
20
|
-
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.
|
|
21
|
-
"integrity": "sha512-
|
|
19
|
+
"version": "3.8.4",
|
|
20
|
+
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz",
|
|
21
|
+
"integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==",
|
|
22
22
|
"dev": true,
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"bin": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-bsblan"
|
|
3
|
-
version = "6.1.
|
|
3
|
+
version = "6.1.3"
|
|
4
4
|
description = "Asynchronous Python client for BSBLAN API"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Willem-Jan van Rootselaar", email = "liudgervr@gmail.com"}
|
|
@@ -189,7 +189,7 @@ dev = [
|
|
|
189
189
|
"blacken-docs==1.20.0",
|
|
190
190
|
"codespell==2.4.2",
|
|
191
191
|
"covdefaults==2.3.0",
|
|
192
|
-
"coverage==7.14.
|
|
192
|
+
"coverage==7.14.1",
|
|
193
193
|
"darglint==1.8.1",
|
|
194
194
|
"flake8==7.3.0",
|
|
195
195
|
"flake8-simplify==0.30.0",
|
|
@@ -206,7 +206,7 @@ dev = [
|
|
|
206
206
|
"pytest-xdist>=3.8.0",
|
|
207
207
|
"pyupgrade==3.21.2",
|
|
208
208
|
"ruff==0.15.16",
|
|
209
|
-
"safety==3.
|
|
209
|
+
"safety==3.8.1",
|
|
210
210
|
"vulture==2.16",
|
|
211
211
|
"yamllint==1.38.0",
|
|
212
212
|
"zeroconf>=0.148.0",
|
|
@@ -19,6 +19,7 @@ from ._version import VersionResolver
|
|
|
19
19
|
from .constants import (
|
|
20
20
|
API_BASIC,
|
|
21
21
|
API_FULL,
|
|
22
|
+
MIN_SUPPORTED_JSON_API,
|
|
22
23
|
APIConfig,
|
|
23
24
|
CircuitConfig,
|
|
24
25
|
ErrorMsg,
|
|
@@ -187,6 +188,13 @@ class BSBLAN:
|
|
|
187
188
|
# circuits == [1, 2] for a dual-circuit controller
|
|
188
189
|
|
|
189
190
|
"""
|
|
191
|
+
if self._json_api_version == MIN_SUPPORTED_JSON_API:
|
|
192
|
+
logger.debug(
|
|
193
|
+
"BSBLAN JSON-API version 1.0 detected; skipping circuit discovery and "
|
|
194
|
+
"assuming only circuit 1 is available"
|
|
195
|
+
)
|
|
196
|
+
self._available_circuits = {1}
|
|
197
|
+
return [1]
|
|
190
198
|
if self._uses_pps_bus:
|
|
191
199
|
return await self._get_available_pps_circuits()
|
|
192
200
|
|
|
@@ -204,8 +212,9 @@ class BSBLAN:
|
|
|
204
212
|
continue
|
|
205
213
|
|
|
206
214
|
# A circuit exists if the response contains the operating mode key
|
|
207
|
-
# with
|
|
208
|
-
|
|
215
|
+
# with a valid value (not an empty dict, and not None/"---").
|
|
216
|
+
param_data = response.get(param_id)
|
|
217
|
+
if not param_data or param_data.get("value") in (None, "---"):
|
|
209
218
|
logger.debug(
|
|
210
219
|
"Circuit %d has no operating mode data (not supported)",
|
|
211
220
|
circuit,
|
|
@@ -230,6 +239,11 @@ class BSBLAN:
|
|
|
230
239
|
logger.debug("PPS climate circuit has no operating mode data")
|
|
231
240
|
self._available_circuits = set()
|
|
232
241
|
return []
|
|
242
|
+
param_data = response[param_id]
|
|
243
|
+
if param_data.get("value") in (None, "---"):
|
|
244
|
+
logger.debug("PPS climate circuit has invalid operating mode value")
|
|
245
|
+
self._available_circuits = set()
|
|
246
|
+
return []
|
|
233
247
|
self._available_circuits = {1}
|
|
234
248
|
return [1]
|
|
235
249
|
|
|
@@ -13,7 +13,12 @@ import pytest
|
|
|
13
13
|
from aresponses import Response, ResponsesMockServer
|
|
14
14
|
|
|
15
15
|
from bsblan import BSBLAN, BSBLANConfig, State, StaticState
|
|
16
|
-
from bsblan.constants import
|
|
16
|
+
from bsblan.constants import (
|
|
17
|
+
MIN_SUPPORTED_JSON_API,
|
|
18
|
+
CircuitConfig,
|
|
19
|
+
ErrorMsg,
|
|
20
|
+
build_api_config,
|
|
21
|
+
)
|
|
17
22
|
from bsblan.exceptions import BSBLANError, BSBLANInvalidParameterError
|
|
18
23
|
from bsblan.utility import APIValidator
|
|
19
24
|
|
|
@@ -769,6 +774,77 @@ async def test_get_available_circuits_all_probes_missing(
|
|
|
769
774
|
] == expected_params
|
|
770
775
|
|
|
771
776
|
|
|
777
|
+
@pytest.mark.asyncio
|
|
778
|
+
async def test_get_available_circuits_inactive_marker_excludes_circuit(
|
|
779
|
+
mock_bsblan_circuit: BSBLAN,
|
|
780
|
+
) -> None:
|
|
781
|
+
"""Test a circuit whose probe value is "---" is excluded."""
|
|
782
|
+
bsblan = mock_bsblan_circuit
|
|
783
|
+
|
|
784
|
+
async def mock_request(
|
|
785
|
+
**kwargs: Any,
|
|
786
|
+
) -> dict[str, Any]:
|
|
787
|
+
params = kwargs.get("params", {})
|
|
788
|
+
param_id = params.get("Parameter", "")
|
|
789
|
+
if param_id == "700":
|
|
790
|
+
return {"700": {"value": "1", "unit": "", "desc": "Automatic"}}
|
|
791
|
+
# HC2 reports the inactive marker value
|
|
792
|
+
if param_id == "1000":
|
|
793
|
+
return {"1000": {"value": "---", "unit": "", "desc": ""}}
|
|
794
|
+
msg = f"Unexpected parameter probe: {param_id}"
|
|
795
|
+
raise AssertionError(msg)
|
|
796
|
+
|
|
797
|
+
bsblan._request = AsyncMock(side_effect=mock_request) # type: ignore[method-assign]
|
|
798
|
+
|
|
799
|
+
circuits = await bsblan.get_available_circuits()
|
|
800
|
+
assert circuits == [1]
|
|
801
|
+
assert bsblan._available_circuits == {1}
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
@pytest.mark.asyncio
|
|
805
|
+
async def test_get_available_circuits_none_value_excludes_circuit(
|
|
806
|
+
mock_bsblan_circuit: BSBLAN,
|
|
807
|
+
) -> None:
|
|
808
|
+
"""Test a circuit whose probe value is None is excluded."""
|
|
809
|
+
bsblan = mock_bsblan_circuit
|
|
810
|
+
|
|
811
|
+
async def mock_request(
|
|
812
|
+
**kwargs: Any,
|
|
813
|
+
) -> dict[str, Any]:
|
|
814
|
+
params = kwargs.get("params", {})
|
|
815
|
+
param_id = params.get("Parameter", "")
|
|
816
|
+
if param_id == "700":
|
|
817
|
+
return {"700": {"value": "1", "unit": "", "desc": "Automatic"}}
|
|
818
|
+
if param_id == "1000":
|
|
819
|
+
return {"1000": {"value": None, "unit": "", "desc": ""}}
|
|
820
|
+
msg = f"Unexpected parameter probe: {param_id}"
|
|
821
|
+
raise AssertionError(msg)
|
|
822
|
+
|
|
823
|
+
bsblan._request = AsyncMock(side_effect=mock_request) # type: ignore[method-assign]
|
|
824
|
+
|
|
825
|
+
circuits = await bsblan.get_available_circuits()
|
|
826
|
+
assert circuits == [1]
|
|
827
|
+
assert bsblan._available_circuits == {1}
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
@pytest.mark.asyncio
|
|
831
|
+
async def test_get_available_circuits_json_api_v1_skips_discovery(
|
|
832
|
+
mock_bsblan_circuit: BSBLAN,
|
|
833
|
+
) -> None:
|
|
834
|
+
"""Test that JSON-API version 1.0 skips circuit discovery and returns [1]."""
|
|
835
|
+
bsblan = mock_bsblan_circuit
|
|
836
|
+
bsblan._json_api_version = MIN_SUPPORTED_JSON_API
|
|
837
|
+
|
|
838
|
+
request_mock = AsyncMock()
|
|
839
|
+
bsblan._request = request_mock # type: ignore[method-assign]
|
|
840
|
+
|
|
841
|
+
circuits = await bsblan.get_available_circuits()
|
|
842
|
+
|
|
843
|
+
assert circuits == [1]
|
|
844
|
+
assert bsblan._available_circuits == {1}
|
|
845
|
+
request_mock.assert_not_awaited()
|
|
846
|
+
|
|
847
|
+
|
|
772
848
|
@pytest.mark.asyncio
|
|
773
849
|
async def test_temperature_range_skips_unavailable_discovered_circuit(
|
|
774
850
|
mock_bsblan_circuit: BSBLAN,
|
|
@@ -357,12 +357,20 @@ async def test_pps_circuit_discovery_returns_single_climate(
|
|
|
357
357
|
|
|
358
358
|
|
|
359
359
|
@pytest.mark.asyncio
|
|
360
|
-
@pytest.mark.parametrize(
|
|
360
|
+
@pytest.mark.parametrize(
|
|
361
|
+
"response",
|
|
362
|
+
[
|
|
363
|
+
{},
|
|
364
|
+
{"15000": {}},
|
|
365
|
+
{"15000": {"value": "---", "unit": "", "desc": ""}},
|
|
366
|
+
{"15000": {"value": None, "unit": "", "desc": ""}},
|
|
367
|
+
],
|
|
368
|
+
)
|
|
361
369
|
async def test_pps_circuit_discovery_returns_empty_without_mode(
|
|
362
370
|
pps_bsblan: BSBLAN,
|
|
363
371
|
response: dict[str, Any],
|
|
364
372
|
) -> None:
|
|
365
|
-
"""Test PPS circuit discovery handles missing
|
|
373
|
+
"""Test PPS circuit discovery handles missing or inactive mode data."""
|
|
366
374
|
pps_bsblan._request = AsyncMock(return_value=response) # type: ignore[method-assign]
|
|
367
375
|
|
|
368
376
|
circuits = await pps_bsblan.get_available_circuits()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|