python-bsblan 5.1.3__tar.gz → 5.1.5__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-5.1.3 → python_bsblan-5.1.5}/.editorconfig +4 -1
- python_bsblan-5.1.5/.github/CONTRIBUTING.md +103 -0
- python_bsblan-5.1.5/.github/SECURITY.md +70 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/copilot-instructions.md +16 -6
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/skills/bsblan-parameters/SKILL.md +3 -1
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/auto-approve-renovate.yml +3 -2
- python_bsblan-5.1.5/.github/workflows/codeql.yaml +32 -0
- python_bsblan-5.1.5/.github/workflows/dependency-review.yaml +21 -0
- python_bsblan-5.1.5/.github/workflows/docs.yaml +60 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/labels.yaml +8 -5
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/linting.yaml +12 -8
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/lock.yaml +6 -4
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/pr-labels.yaml +2 -1
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/release-drafter.yaml +7 -5
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/release.yaml +22 -10
- python_bsblan-5.1.5/.github/workflows/scorecard.yml +71 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/stale.yaml +5 -4
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/workflows/tests.yaml +22 -13
- python_bsblan-5.1.5/.github/workflows/typing.yaml +42 -0
- python_bsblan-5.1.5/.github/zizmor.yml +12 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.gitignore +3 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.pre-commit-config.yaml +4 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/Makefile +8 -1
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/PKG-INFO +39 -86
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/README.md +37 -84
- python_bsblan-5.1.5/docs/api/client.md +32 -0
- python_bsblan-5.1.5/docs/api/constants.md +29 -0
- python_bsblan-5.1.5/docs/api/exceptions.md +15 -0
- python_bsblan-5.1.5/docs/api/models.md +77 -0
- python_bsblan-5.1.5/docs/getting-started.md +93 -0
- python_bsblan-5.1.5/docs/index.md +32 -0
- python_bsblan-5.1.5/mkdocs.yml +69 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/package-lock.json +4 -4
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/package.json +1 -1
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/pyproject.toml +9 -5
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/src/bsblan/bsblan.py +74 -172
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/src/bsblan/constants.py +143 -147
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/src/bsblan/exceptions.py +3 -4
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/conftest.py +0 -3
- python_bsblan-5.1.5/tests/test_api_initialization.py +59 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_api_validation.py +4 -5
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_bsblan_edge_cases.py +0 -48
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_circuit.py +18 -16
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_configuration.py +7 -7
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_constants.py +11 -13
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_dhw_time_switch.py +2 -2
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_include_parameter.py +5 -6
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_initialization.py +19 -85
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_set_hotwater.py +3 -3
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_temperature_unit.py +9 -9
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_temperature_validation.py +18 -16
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_thermostat.py +4 -5
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_version_errors.py +6 -6
- python_bsblan-5.1.3/.github/CONTRIBUTING.md +0 -29
- python_bsblan-5.1.3/.github/workflows/codeql.yaml +0 -29
- python_bsblan-5.1.3/tests/test_api_initialization.py +0 -103
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.gitattributes +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/CODE_OF_CONDUCT.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/ISSUE_TEMPLATE/PULL_REQUEST_TEMPLATE.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/labels.yml +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/prompts/add-parameter.prompt.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/prompts/code-review.prompt.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/release-drafter.yml +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/renovate.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.github/skills/bsblan-testing/SKILL.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.nvmrc +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.prettierignore +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/.yamllint +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/AGENTS.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/CLAUDE.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/LICENSE.md +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/examples/control.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/examples/discovery.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/examples/fetch_param.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/examples/profile_init.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/examples/ruff.toml +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/examples/speed_test.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/sonar-project.properties +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/src/bsblan/__init__.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/src/bsblan/models.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/src/bsblan/py.typed +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/src/bsblan/utility.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/__init__.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/device.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/dict_version.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/hot_water_state.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/info.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/password.txt +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/sensor.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/state.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/state_circuit2.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/static_state.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/static_state_circuit2.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/thermostat_hvac.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/thermostat_temp.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/fixtures/time.json +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/ruff.toml +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_auth.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_backoff_retry.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_bsblan.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_context_manager.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_device.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_entity_info.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_entity_info_ha.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_hot_water_additional.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_hotwater_state.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_info.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_read_parameters.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_reset_validation.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_schedule_models.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_sensor.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_set_hot_water_schedule.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_state.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_static_state.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_time.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_utility.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_utility_additional.py +0 -0
- {python_bsblan-5.1.3 → python_bsblan-5.1.5}/tests/test_utility_edge_cases.py +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Contributing to python-bsblan
|
|
2
|
+
|
|
3
|
+
When contributing to this repository, please first discuss the change you wish
|
|
4
|
+
to make via issue, email, or any other method with the owners of this repository
|
|
5
|
+
before making a change.
|
|
6
|
+
|
|
7
|
+
Please note we have a [code of conduct][coc], please follow it in all your
|
|
8
|
+
interactions with the project.
|
|
9
|
+
|
|
10
|
+
## Issues and feature requests
|
|
11
|
+
|
|
12
|
+
You've found a bug in the source code, a mistake in the documentation or maybe
|
|
13
|
+
you'd like a new feature? You can help us by [submitting an issue][issues].
|
|
14
|
+
Before you create an issue, make sure you search
|
|
15
|
+
the archive, maybe your question was already answered.
|
|
16
|
+
|
|
17
|
+
Even better: You could submit a pull request with a fix / new feature!
|
|
18
|
+
|
|
19
|
+
## Development setup
|
|
20
|
+
|
|
21
|
+
This project uses [uv](https://docs.astral.sh/uv/) for Python dependency
|
|
22
|
+
management and [Node.js](https://nodejs.org/) for Prettier (formatting of
|
|
23
|
+
JSON, Markdown, and YAML files).
|
|
24
|
+
|
|
25
|
+
### Prerequisites
|
|
26
|
+
|
|
27
|
+
- **Python 3.12+**
|
|
28
|
+
- **uv** — install via `pip install uv` or see [uv docs](https://docs.astral.sh/uv/getting-started/installation/)
|
|
29
|
+
- **Node.js** (LTS) — required for the Prettier pre-commit hook
|
|
30
|
+
|
|
31
|
+
### Setup
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Clone the repository
|
|
35
|
+
git clone https://github.com/liudger/python-bsblan.git
|
|
36
|
+
cd python-bsblan
|
|
37
|
+
|
|
38
|
+
# Install all dependencies and git hooks
|
|
39
|
+
make setup
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This runs `uv sync --dev` (Python deps), `npm ci` (Prettier), and
|
|
43
|
+
`uv run prek install` (pre-commit hooks).
|
|
44
|
+
|
|
45
|
+
## Coding standards
|
|
46
|
+
|
|
47
|
+
All contributions must follow these requirements:
|
|
48
|
+
|
|
49
|
+
- **Python 3.12+** — use modern Python features and type hints on all functions
|
|
50
|
+
- **Line length** — maximum 88 characters (enforced by Ruff)
|
|
51
|
+
- **Linting** — code must pass Ruff, ty, and Pylint checks
|
|
52
|
+
- **Formatting** — code is formatted with Ruff (based on Black style)
|
|
53
|
+
- **Naming** — use `snake_case` for all parameter names and follow existing
|
|
54
|
+
patterns in the codebase
|
|
55
|
+
- **Docstrings** — required on all public methods
|
|
56
|
+
|
|
57
|
+
### Running quality checks
|
|
58
|
+
|
|
59
|
+
Before submitting a pull request, run all pre-commit hooks:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv run prek run --all-files
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This runs Ruff (linting + formatting), ty (type checking), and Pylint
|
|
66
|
+
(code analysis) in one command.
|
|
67
|
+
|
|
68
|
+
## Testing requirements
|
|
69
|
+
|
|
70
|
+
- **Test coverage** — aim for **95%+ total coverage**
|
|
71
|
+
- **Patch coverage** — all new or modified code should have **100% coverage**
|
|
72
|
+
- **Framework** — tests use `pytest` with `pytest-asyncio`
|
|
73
|
+
|
|
74
|
+
Coverage is tracked via [Codecov](https://codecov.io/) and reviewed during
|
|
75
|
+
pull requests. Please ensure your changes include adequate tests.
|
|
76
|
+
|
|
77
|
+
Run the test suite:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
uv run pytest --cov=src/bsblan --cov-report=term-missing
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Pull request process
|
|
84
|
+
|
|
85
|
+
1. Search our repository for open or closed [pull requests][prs] that relate
|
|
86
|
+
to your submission. You don't want to duplicate effort.
|
|
87
|
+
|
|
88
|
+
2. Fork the repository and create your branch from `main`.
|
|
89
|
+
|
|
90
|
+
3. Make your changes, ensuring all coding standards and testing requirements
|
|
91
|
+
above are met.
|
|
92
|
+
|
|
93
|
+
4. Run `uv run prek run --all-files` to verify all checks pass.
|
|
94
|
+
|
|
95
|
+
5. Submit your pull request with a clear description of the changes.
|
|
96
|
+
|
|
97
|
+
6. You may merge the pull request once you have the sign-off of the project
|
|
98
|
+
maintainer, or if you do not have permission to do that, you may request
|
|
99
|
+
the maintainer to merge it for you.
|
|
100
|
+
|
|
101
|
+
[issues]: https://github.com/liudger/python-bsblan/issues
|
|
102
|
+
[prs]: https://github.com/liudger/python-bsblan/pulls
|
|
103
|
+
[coc]: https://github.com/liudger/python-bsblan/blob/main/.github/CODE_OF_CONDUCT.md
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
The security of this project is taken seriously. We appreciate your efforts to
|
|
4
|
+
responsibly disclose any findings and will make every effort to acknowledge your
|
|
5
|
+
contributions.
|
|
6
|
+
|
|
7
|
+
## Supported Versions
|
|
8
|
+
|
|
9
|
+
Security updates are provided only for the latest released version of this
|
|
10
|
+
library on PyPI. Users are strongly encouraged to keep their installations up to
|
|
11
|
+
date.
|
|
12
|
+
|
|
13
|
+
| | Supported |
|
|
14
|
+
| -------------- | --------- |
|
|
15
|
+
| Latest release | ✅ |
|
|
16
|
+
| Older releases | ❌ |
|
|
17
|
+
|
|
18
|
+
## Reporting a Vulnerability
|
|
19
|
+
|
|
20
|
+
Please do not report security vulnerabilities through public GitHub issues,
|
|
21
|
+
discussions, or pull requests.
|
|
22
|
+
|
|
23
|
+
Instead, report them privately through GitHub's private vulnerability reporting:
|
|
24
|
+
|
|
25
|
+
[Report a vulnerability](https://github.com/liudger/python-bsblan/security/advisories/new)
|
|
26
|
+
|
|
27
|
+
If for any reason you are unable to use GitHub's private vulnerability
|
|
28
|
+
reporting, you may also reach out to the maintainer by email at
|
|
29
|
+
[liudgervr@gmail.com](mailto:liudgervr@gmail.com).
|
|
30
|
+
|
|
31
|
+
When reporting, please include as much of the following as possible:
|
|
32
|
+
|
|
33
|
+
- A clear description of the vulnerability and its potential impact.
|
|
34
|
+
- Steps to reproduce, or a proof of concept.
|
|
35
|
+
- Affected version(s) of the library.
|
|
36
|
+
- Any known mitigations or workarounds.
|
|
37
|
+
|
|
38
|
+
## Disclosure Timeline
|
|
39
|
+
|
|
40
|
+
- **Acknowledgement**: you will receive an acknowledgement of your report
|
|
41
|
+
within 48 hours.
|
|
42
|
+
- **Initial assessment**: a triage and initial severity assessment will be
|
|
43
|
+
shared within 7 days of the acknowledgement.
|
|
44
|
+
- **Fix and disclosure**: valid reports are targeted for resolution and
|
|
45
|
+
coordinated public disclosure within 90 days of the initial report,
|
|
46
|
+
depending on complexity and impact.
|
|
47
|
+
|
|
48
|
+
You will be kept informed throughout the process and credited in the release
|
|
49
|
+
notes for the fix, unless you prefer to remain anonymous.
|
|
50
|
+
|
|
51
|
+
## Out of Scope
|
|
52
|
+
|
|
53
|
+
The following are not considered security vulnerabilities in this project:
|
|
54
|
+
|
|
55
|
+
- Vulnerabilities in upstream or transitive dependencies. These are handled
|
|
56
|
+
continuously by [Renovate](https://github.com/renovatebot/renovate) and
|
|
57
|
+
addressed through regular dependency updates.
|
|
58
|
+
- Issues only reproducible on Python versions older than those listed as
|
|
59
|
+
supported in `pyproject.toml`.
|
|
60
|
+
- Issues in the BSB-LAN firmware itself; please report those directly to the
|
|
61
|
+
[BSB-LAN project](https://github.com/fredlcore/BSB-LAN).
|
|
62
|
+
- Denial-of-service or data-exposure conditions resulting from malformed or
|
|
63
|
+
hostile responses from a BSB-LAN device the client is explicitly pointed at.
|
|
64
|
+
This library assumes the configured endpoint is trusted.
|
|
65
|
+
|
|
66
|
+
## Scope
|
|
67
|
+
|
|
68
|
+
This security policy covers the `python-bsblan` Python package published on
|
|
69
|
+
[PyPI](https://pypi.org/project/python-bsblan/) and its source code in this
|
|
70
|
+
repository.
|
|
@@ -16,13 +16,13 @@ This repository contains the `python-bsblan` library, an asynchronous Python cli
|
|
|
16
16
|
Always run these commands after making changes:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
# Run all prek hooks (ruff,
|
|
19
|
+
# Run all prek hooks (ruff, ty, pylint)
|
|
20
20
|
uv run prek run --all-files
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
### Prek Includes
|
|
24
24
|
- **Ruff**: Linting and formatting (88 char line limit)
|
|
25
|
-
- **
|
|
25
|
+
- **ty**: Static type checking
|
|
26
26
|
- **Pylint**: Code analysis
|
|
27
27
|
|
|
28
28
|
### Coverage Requirements
|
|
@@ -84,9 +84,15 @@ Parameters are identified by numeric IDs and mapped to readable names in `consta
|
|
|
84
84
|
```python
|
|
85
85
|
async def set_hot_water(
|
|
86
86
|
self,
|
|
87
|
-
|
|
87
|
+
params: SetHotWaterParam,
|
|
88
88
|
) -> None:
|
|
89
89
|
```
|
|
90
|
+
And add the field to `SetHotWaterParam` in `models.py`:
|
|
91
|
+
```python
|
|
92
|
+
@dataclass
|
|
93
|
+
class SetHotWaterParam:
|
|
94
|
+
legionella_function_setpoint: float | None = None
|
|
95
|
+
```
|
|
90
96
|
|
|
91
97
|
4. **Add tests in `tests/test_*.py`**
|
|
92
98
|
|
|
@@ -149,9 +155,11 @@ Each parameter returns an `EntityInfo[T]` (generic `BaseModel`) with:
|
|
|
149
155
|
|
|
150
156
|
### Client Usage
|
|
151
157
|
```python
|
|
152
|
-
|
|
158
|
+
from bsblan import BSBLAN, BSBLANConfig, SetHotWaterParam
|
|
159
|
+
|
|
160
|
+
async with BSBLAN(BSBLANConfig(host="192.168.1.100")) as client:
|
|
153
161
|
state = await client.state()
|
|
154
|
-
await client.set_hot_water(nominal_setpoint=55.0)
|
|
162
|
+
await client.set_hot_water(SetHotWaterParam(nominal_setpoint=55.0))
|
|
155
163
|
```
|
|
156
164
|
|
|
157
165
|
### Lazy Loading Architecture
|
|
@@ -199,7 +207,9 @@ This prevents duplicate network requests when concurrent calls access the same s
|
|
|
199
207
|
@pytest.mark.asyncio
|
|
200
208
|
async def test_set_hot_water(mock_bsblan: BSBLAN) -> None:
|
|
201
209
|
"""Test setting BSBLAN hot water state."""
|
|
202
|
-
await mock_bsblan.set_hot_water(
|
|
210
|
+
await mock_bsblan.set_hot_water(
|
|
211
|
+
SetHotWaterParam(nominal_setpoint=60.0)
|
|
212
|
+
)
|
|
203
213
|
mock_bsblan._request.assert_awaited_with(
|
|
204
214
|
base_path="/JS",
|
|
205
215
|
data={"Parameter": "1610", "Value": "60.0", "Type": "1"},
|
|
@@ -105,7 +105,9 @@ Create tests in `tests/test_*.py`:
|
|
|
105
105
|
@pytest.mark.asyncio
|
|
106
106
|
async def test_set_hot_water(mock_bsblan: BSBLAN) -> None:
|
|
107
107
|
"""Test setting BSBLAN hot water state."""
|
|
108
|
-
await mock_bsblan.set_hot_water(
|
|
108
|
+
await mock_bsblan.set_hot_water(
|
|
109
|
+
SetHotWaterParam(nominal_setpoint=60.0)
|
|
110
|
+
)
|
|
109
111
|
mock_bsblan._request.assert_awaited_with(
|
|
110
112
|
base_path="/JS",
|
|
111
113
|
data={"Parameter": "1610", "Value": "60.0", "Type": "1"},
|
|
@@ -9,12 +9,13 @@ on:
|
|
|
9
9
|
- synchronize
|
|
10
10
|
- reopened
|
|
11
11
|
|
|
12
|
-
permissions:
|
|
13
|
-
pull-requests: write
|
|
12
|
+
permissions: read-all
|
|
14
13
|
|
|
15
14
|
jobs:
|
|
16
15
|
auto-approve:
|
|
17
16
|
runs-on: ubuntu-latest
|
|
17
|
+
permissions:
|
|
18
|
+
pull-requests: write
|
|
18
19
|
if: >-
|
|
19
20
|
github.actor == 'renovate[bot]' &&
|
|
20
21
|
github.actor_id == '29139614' &&
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "CodeQL"
|
|
3
|
+
|
|
4
|
+
# yamllint disable-line rule:truthy
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [main]
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
schedule:
|
|
12
|
+
- cron: "30 1 * * 0"
|
|
13
|
+
|
|
14
|
+
permissions: read-all
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
codeql:
|
|
18
|
+
name: Scanning
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
actions: read
|
|
22
|
+
contents: read
|
|
23
|
+
security-events: write
|
|
24
|
+
steps:
|
|
25
|
+
- name: ⤵️ Check out code from GitHub
|
|
26
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- name: 🏗 Initialize CodeQL
|
|
30
|
+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
|
31
|
+
- name: 🚀 Perform CodeQL Analysis
|
|
32
|
+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Dependency Review
|
|
3
|
+
|
|
4
|
+
# yamllint disable-line rule:truthy
|
|
5
|
+
on: [pull_request]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
dependency-review:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: ⤵️ Check out code from GitHub
|
|
15
|
+
# yamllint disable-line rule:line-length
|
|
16
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
17
|
+
with:
|
|
18
|
+
persist-credentials: false
|
|
19
|
+
- name: 👀 Dependency review
|
|
20
|
+
# yamllint disable-line rule:line-length
|
|
21
|
+
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Documentation
|
|
3
|
+
|
|
4
|
+
# yamllint disable-line rule:truthy
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: pages
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
DEFAULT_PYTHON: "3.13"
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
build:
|
|
22
|
+
name: Build documentation
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- name: ⤵️ Check out code from GitHub
|
|
26
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- name: 🏗 Set up uv
|
|
30
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
|
|
31
|
+
with:
|
|
32
|
+
enable-cache: true
|
|
33
|
+
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
|
|
34
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
35
|
+
with:
|
|
36
|
+
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
37
|
+
- name: 🏗 Install dependencies
|
|
38
|
+
run: uv sync --group docs
|
|
39
|
+
- name: 🏗 Build documentation
|
|
40
|
+
run: uv run mkdocs build --strict
|
|
41
|
+
- name: 📤 Upload artifact
|
|
42
|
+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
|
43
|
+
with:
|
|
44
|
+
path: site
|
|
45
|
+
|
|
46
|
+
deploy:
|
|
47
|
+
name: Deploy to GitHub Pages
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
needs: build
|
|
50
|
+
if: github.ref == 'refs/heads/main'
|
|
51
|
+
permissions:
|
|
52
|
+
pages: write
|
|
53
|
+
id-token: write
|
|
54
|
+
environment:
|
|
55
|
+
name: github-pages
|
|
56
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
57
|
+
steps:
|
|
58
|
+
- name: 🚀 Deploy to GitHub Pages
|
|
59
|
+
id: deployment
|
|
60
|
+
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
|
|
@@ -10,18 +10,21 @@ on:
|
|
|
10
10
|
- .github/labels.yml
|
|
11
11
|
workflow_dispatch:
|
|
12
12
|
|
|
13
|
-
permissions:
|
|
14
|
-
contents: read
|
|
15
|
-
issues: write
|
|
13
|
+
permissions: read-all
|
|
16
14
|
|
|
17
15
|
jobs:
|
|
18
16
|
labels:
|
|
19
17
|
name: ♻️ Sync labels
|
|
20
18
|
runs-on: ubuntu-latest
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
issues: write
|
|
21
22
|
steps:
|
|
22
23
|
- name: ⤵️ Check out code from GitHub
|
|
23
|
-
uses: actions/checkout@v6.0.2
|
|
24
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
24
27
|
- name: 🚀 Run Label Syncer
|
|
25
|
-
uses: micnncim/action-label-syncer@v1.3.0
|
|
28
|
+
uses: micnncim/action-label-syncer@3abd5ab72fda571e69fffd97bd4e0033dd5f495c # v1.3.0
|
|
26
29
|
env:
|
|
27
30
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -21,14 +21,16 @@ jobs:
|
|
|
21
21
|
runs-on: ubuntu-latest
|
|
22
22
|
steps:
|
|
23
23
|
- name: ⤵️ Check out code from GitHub
|
|
24
|
-
uses: actions/checkout@v6.0.2
|
|
24
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
25
27
|
- name: 🏗 Set up uv
|
|
26
|
-
uses: astral-sh/setup-uv@v7
|
|
28
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
|
|
27
29
|
with:
|
|
28
30
|
enable-cache: true
|
|
29
31
|
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
|
|
30
32
|
id: python
|
|
31
|
-
uses: actions/setup-python@v6.2.0
|
|
33
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
32
34
|
with:
|
|
33
35
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
34
36
|
- name: 🏗 Install Python dependencies
|
|
@@ -43,24 +45,26 @@ jobs:
|
|
|
43
45
|
runs-on: ubuntu-latest
|
|
44
46
|
steps:
|
|
45
47
|
- name: ⤵️ Check out code from GitHub
|
|
46
|
-
uses: actions/checkout@v6.0.2
|
|
48
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
49
|
+
with:
|
|
50
|
+
persist-credentials: false
|
|
47
51
|
- name: 🏗 Set up uv
|
|
48
|
-
uses: astral-sh/setup-uv@v7
|
|
52
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
|
|
49
53
|
with:
|
|
50
54
|
enable-cache: true
|
|
51
55
|
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
|
|
52
56
|
id: python
|
|
53
|
-
uses: actions/setup-python@v6.2.0
|
|
57
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
54
58
|
with:
|
|
55
59
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
56
60
|
- name: 🏗 Install Python dependencies
|
|
57
61
|
run: uv sync --dev
|
|
58
62
|
- name: 🏗 Set up Node.js
|
|
59
|
-
uses: actions/setup-node@v6.
|
|
63
|
+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
60
64
|
with:
|
|
61
65
|
node-version-file: ".nvmrc"
|
|
62
66
|
cache: "npm"
|
|
63
67
|
- name: 🏗 Install NPM dependencies
|
|
64
|
-
run: npm
|
|
68
|
+
run: npm ci
|
|
65
69
|
- name: 🚀 Run prettier
|
|
66
70
|
run: uv run prek run prettier --all-files
|
|
@@ -7,16 +7,18 @@ on:
|
|
|
7
7
|
- cron: "0 9 * * *"
|
|
8
8
|
workflow_dispatch:
|
|
9
9
|
|
|
10
|
-
permissions:
|
|
11
|
-
issues: write
|
|
12
|
-
pull-requests: write
|
|
10
|
+
permissions: read-all
|
|
13
11
|
|
|
14
12
|
jobs:
|
|
15
13
|
lock:
|
|
16
14
|
name: 🔒 Lock closed issues and PRs
|
|
17
15
|
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
issues: write
|
|
18
|
+
pull-requests: write
|
|
18
19
|
steps:
|
|
19
|
-
-
|
|
20
|
+
# yamllint disable-line rule:line-length
|
|
21
|
+
- uses: dessant/lock-threads@7266a7ce5c1df01b1c6db85bf8cd86c737dadbe7 # v6.0.0
|
|
20
22
|
with:
|
|
21
23
|
github-token: ${{ github.token }}
|
|
22
24
|
issue-inactive-days: "30"
|
|
@@ -20,7 +20,8 @@ jobs:
|
|
|
20
20
|
runs-on: ubuntu-latest
|
|
21
21
|
steps:
|
|
22
22
|
- name: 🏷 Verify PR has a valid label
|
|
23
|
-
|
|
23
|
+
# yamllint disable-line rule:line-length
|
|
24
|
+
uses: jesusvasquez333/verify-pr-label-action@657d111bbbe13e22bbd55870f1813c699bde1401 # v1.4.0
|
|
24
25
|
with:
|
|
25
26
|
pull-request-number: "${{ github.event.pull_request.number }}"
|
|
26
27
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
@@ -23,18 +23,20 @@ on:
|
|
|
23
23
|
- alpha
|
|
24
24
|
- rc
|
|
25
25
|
|
|
26
|
-
permissions:
|
|
27
|
-
contents: write
|
|
28
|
-
issues: read
|
|
29
|
-
pull-requests: read
|
|
26
|
+
permissions: read-all
|
|
30
27
|
|
|
31
28
|
jobs:
|
|
32
29
|
update_release_draft:
|
|
33
30
|
name: ✏️ Draft release
|
|
34
31
|
runs-on: ubuntu-latest
|
|
32
|
+
permissions:
|
|
33
|
+
contents: write
|
|
34
|
+
issues: read
|
|
35
|
+
pull-requests: read
|
|
35
36
|
steps:
|
|
36
37
|
- name: 🚀 Run Release Drafter
|
|
37
|
-
|
|
38
|
+
# yamllint disable-line rule:line-length
|
|
39
|
+
uses: release-drafter/release-drafter@5de93583980a40bd78603b6dfdcda5b4df377b32 # v7.2.0
|
|
38
40
|
with:
|
|
39
41
|
prerelease: ${{ github.event.inputs.prerelease == 'true' }}
|
|
40
42
|
prerelease-identifier: ${{ github.event.inputs.prerelease_identifier }}
|
|
@@ -7,6 +7,8 @@ on:
|
|
|
7
7
|
types:
|
|
8
8
|
- published
|
|
9
9
|
|
|
10
|
+
permissions: read-all
|
|
11
|
+
|
|
10
12
|
env:
|
|
11
13
|
DEFAULT_PYTHON: "3.13"
|
|
12
14
|
|
|
@@ -18,37 +20,46 @@ jobs:
|
|
|
18
20
|
name: release
|
|
19
21
|
url: https://pypi.org/p/python-bsblan
|
|
20
22
|
permissions:
|
|
23
|
+
attestations: write
|
|
21
24
|
contents: write
|
|
22
25
|
id-token: write
|
|
23
26
|
steps:
|
|
24
27
|
- name: ⤵️ Check out code from GitHub
|
|
25
|
-
uses: actions/checkout@v6.0.2
|
|
28
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
26
31
|
- name: 🏗 Set up uv
|
|
27
|
-
uses: astral-sh/setup-uv@v7
|
|
32
|
+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
|
|
28
33
|
with:
|
|
29
|
-
enable-cache:
|
|
34
|
+
enable-cache: false
|
|
30
35
|
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
|
|
31
36
|
id: python
|
|
32
|
-
uses: actions/setup-python@v6.2.0
|
|
37
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
33
38
|
with:
|
|
34
39
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
|
35
40
|
- name: 🏗 Install dependencies
|
|
36
41
|
run: uv sync
|
|
37
42
|
- name: 🏗 Set package version
|
|
43
|
+
env:
|
|
44
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
38
45
|
run: |
|
|
39
|
-
version="${
|
|
46
|
+
version="${RELEASE_TAG}"
|
|
40
47
|
version="${version,,}"
|
|
41
48
|
version="${version#v}"
|
|
42
49
|
sed -i '0,/version = ".*"/{s/version = ".*"/version = "'"${version}"'"/}' pyproject.toml
|
|
43
50
|
- name: 🏗 Build package
|
|
44
51
|
run: uv build
|
|
52
|
+
- name: 🔏 Attest build provenance
|
|
53
|
+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
|
54
|
+
with:
|
|
55
|
+
subject-path: ./dist/*
|
|
45
56
|
- name: 🚀 Publish to PyPi
|
|
46
|
-
uses: pypa/gh-action-pypi-publish@v1.
|
|
57
|
+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
|
|
47
58
|
with:
|
|
48
59
|
verbose: true
|
|
49
60
|
print-hash: true
|
|
50
61
|
- name: ✍️ Sign published artifacts
|
|
51
|
-
uses: sigstore/gh-action-sigstore-python@v3.
|
|
62
|
+
uses: sigstore/gh-action-sigstore-python@04cffa1d795717b140764e8b640de88853c92acc # v3.3.0
|
|
52
63
|
with:
|
|
53
64
|
inputs: ./dist/*.tar.gz ./dist/*.whl
|
|
54
65
|
release-signing-artifacts: false
|
|
@@ -128,13 +139,16 @@ jobs:
|
|
|
128
139
|
echo "Found files: $FILES"
|
|
129
140
|
- name: 📤 Upload signature files to release
|
|
130
141
|
if: github.event_name == 'release' && github.event.action == 'published'
|
|
142
|
+
env:
|
|
143
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
144
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
131
145
|
run: |
|
|
132
146
|
# Upload files individually to avoid Node.js file handle issues
|
|
133
147
|
for file in ./dist/*.sigstore.json; do
|
|
134
148
|
if [ -f "$file" ]; then
|
|
135
149
|
echo "Uploading $file..."
|
|
136
150
|
# Use GitHub CLI for more reliable uploads
|
|
137
|
-
gh release upload ${
|
|
151
|
+
gh release upload "${RELEASE_TAG}" "$file" --clobber
|
|
138
152
|
if [ $? -ne 0 ]; then
|
|
139
153
|
echo "✗ Failed to upload $file" >&2
|
|
140
154
|
exit 1
|
|
@@ -143,5 +157,3 @@ jobs:
|
|
|
143
157
|
sleep 1 # Small delay between uploads
|
|
144
158
|
fi
|
|
145
159
|
done
|
|
146
|
-
env:
|
|
147
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|