aioetatouch 0.1.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.
- aioetatouch-0.1.0/.github/workflows/ci.yml +32 -0
- aioetatouch-0.1.0/.github/workflows/publish.yml +59 -0
- aioetatouch-0.1.0/.github/workflows/release-please.yml +16 -0
- aioetatouch-0.1.0/.gitignore +12 -0
- aioetatouch-0.1.0/.release-please-config.json +11 -0
- aioetatouch-0.1.0/.release-please-manifest.json +1 -0
- aioetatouch-0.1.0/CHANGELOG.md +8 -0
- aioetatouch-0.1.0/LICENSE +201 -0
- aioetatouch-0.1.0/PKG-INFO +81 -0
- aioetatouch-0.1.0/README.md +68 -0
- aioetatouch-0.1.0/RELEASING.md +65 -0
- aioetatouch-0.1.0/pyproject.toml +67 -0
- aioetatouch-0.1.0/src/aioetatouch/__init__.py +51 -0
- aioetatouch-0.1.0/src/aioetatouch/__main__.py +7 -0
- aioetatouch-0.1.0/src/aioetatouch/cli.py +340 -0
- aioetatouch-0.1.0/src/aioetatouch/client.py +134 -0
- aioetatouch-0.1.0/src/aioetatouch/exceptions.py +33 -0
- aioetatouch-0.1.0/src/aioetatouch/models.py +147 -0
- aioetatouch-0.1.0/src/aioetatouch/parser.py +244 -0
- aioetatouch-0.1.0/src/aioetatouch/py.typed +0 -0
- aioetatouch-0.1.0/tests/conftest.py +140 -0
- aioetatouch-0.1.0/tests/fixtures/api.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/errors.xml +13 -0
- aioetatouch-0.1.0/tests/fixtures/errors_synthetic.xml +12 -0
- aioetatouch-0.1.0/tests/fixtures/menu.xml +1181 -0
- aioetatouch-0.1.0/tests/fixtures/response_error_400.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/response_success_201.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/var_content.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/var_counter.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/var_state.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/var_temp.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/varinfo_content.xml +13 -0
- aioetatouch-0.1.0/tests/fixtures/varinfo_counter.xml +8 -0
- aioetatouch-0.1.0/tests/fixtures/varinfo_state.xml +30 -0
- aioetatouch-0.1.0/tests/fixtures/varinfo_temp.xml +8 -0
- aioetatouch-0.1.0/tests/fixtures/vars_empty.xml +2 -0
- aioetatouch-0.1.0/tests/fixtures/vars_list.xml +4 -0
- aioetatouch-0.1.0/tests/fixtures/vars_set.xml +7 -0
- aioetatouch-0.1.0/tests/test_cli.py +345 -0
- aioetatouch-0.1.0/tests/test_client.py +207 -0
- aioetatouch-0.1.0/tests/test_models.py +111 -0
- aioetatouch-0.1.0/tests/test_package.py +7 -0
- aioetatouch-0.1.0/tests/test_parser.py +239 -0
- aioetatouch-0.1.0/uv.lock +941 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
python-version: ["3.12", "3.13"]
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Install uv
|
|
17
|
+
uses: astral-sh/setup-uv@v3
|
|
18
|
+
|
|
19
|
+
- name: Sync dependencies
|
|
20
|
+
run: uv sync --python ${{ matrix.python-version }}
|
|
21
|
+
|
|
22
|
+
- name: Ruff check
|
|
23
|
+
run: uv run ruff check .
|
|
24
|
+
|
|
25
|
+
- name: Ruff format check
|
|
26
|
+
run: uv run ruff format --check .
|
|
27
|
+
|
|
28
|
+
- name: Mypy
|
|
29
|
+
run: uv run mypy
|
|
30
|
+
|
|
31
|
+
- name: Pytest
|
|
32
|
+
run: uv run pytest --cov --cov-report=term-missing
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
ref: ${{ github.event.release.tag_name }}
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v3
|
|
20
|
+
|
|
21
|
+
- name: Sync dependencies
|
|
22
|
+
run: uv sync
|
|
23
|
+
|
|
24
|
+
- name: Run tests
|
|
25
|
+
run: uv run pytest
|
|
26
|
+
|
|
27
|
+
- name: Verify package version matches release tag
|
|
28
|
+
run: |
|
|
29
|
+
PKG_VERSION="$(uv run python -c 'import aioetatouch; print(aioetatouch.__version__)')"
|
|
30
|
+
TAG="${{ github.event.release.tag_name }}"
|
|
31
|
+
if [ "$PKG_VERSION" != "$TAG" ]; then
|
|
32
|
+
echo "::error::Package version ($PKG_VERSION) does not match release tag ($TAG)"
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
- name: Build package
|
|
37
|
+
run: uv build
|
|
38
|
+
|
|
39
|
+
- name: Upload build artifact
|
|
40
|
+
uses: actions/upload-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: dist
|
|
43
|
+
path: dist/
|
|
44
|
+
|
|
45
|
+
publish:
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment: pypi
|
|
49
|
+
permissions:
|
|
50
|
+
id-token: write
|
|
51
|
+
steps:
|
|
52
|
+
- name: Download build artifact
|
|
53
|
+
uses: actions/download-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: dist
|
|
56
|
+
path: dist/
|
|
57
|
+
|
|
58
|
+
- name: Publish to PyPI
|
|
59
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Release Please
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
permissions:
|
|
7
|
+
contents: write
|
|
8
|
+
pull-requests: write
|
|
9
|
+
jobs:
|
|
10
|
+
release-please:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: googleapis/release-please-action@v4
|
|
14
|
+
with:
|
|
15
|
+
config-file: .release-please-config.json
|
|
16
|
+
manifest-file: .release-please-manifest.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{".":"0.1.0"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing
|
|
141
|
+
the origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 g4bri3lDev
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aioetatouch
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Async Python client for the ETAtouch REST API of ETA heating systems
|
|
5
|
+
Author-email: g4bri3lDev <admin@g4bri3l.de>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Requires-Dist: aiohttp>=3.9
|
|
10
|
+
Provides-Extra: cli
|
|
11
|
+
Requires-Dist: rich>=13; extra == 'cli'
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# aioetatouch
|
|
15
|
+
|
|
16
|
+
Async Python client for the ETAtouch REST API of ETA heating systems.
|
|
17
|
+
|
|
18
|
+
This project is a work in progress. The API surface is not yet stable.
|
|
19
|
+
|
|
20
|
+
Requires Python >=3.12.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install aioetatouch
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
The caller owns the `aiohttp.ClientSession` (the Home Assistant convention);
|
|
31
|
+
`EtaClient` never creates or closes it.
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import asyncio
|
|
35
|
+
|
|
36
|
+
import aiohttp
|
|
37
|
+
|
|
38
|
+
from aioetatouch import EtaClient
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
async def main() -> None:
|
|
42
|
+
async with aiohttp.ClientSession() as session:
|
|
43
|
+
client = EtaClient("192.168.1.50", session)
|
|
44
|
+
|
|
45
|
+
tree = await client.get_menu()
|
|
46
|
+
for node in tree:
|
|
47
|
+
print(node.uri, node.name)
|
|
48
|
+
|
|
49
|
+
value = await client.get_var("/120/10101/0/0/12197")
|
|
50
|
+
print(f"{value.scaled} {value.unit}")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
asyncio.run(main())
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Read-only, with one caveat
|
|
57
|
+
|
|
58
|
+
`EtaClient` is read-only with respect to variable *values* -- there is no
|
|
59
|
+
method to write a heater's setpoint or state. The one exception is the
|
|
60
|
+
`create_set` / `delete_set` / `add_to_set` / `remove_from_set` methods, which
|
|
61
|
+
intentionally mutate the device's web-service variable-set containers
|
|
62
|
+
(required for bulk polling); they never touch a heater value.
|
|
63
|
+
|
|
64
|
+
### Errors
|
|
65
|
+
|
|
66
|
+
All exceptions inherit from `EtaError`:
|
|
67
|
+
|
|
68
|
+
- `EtaParseError` -- an ETAtouch XML response could not be parsed.
|
|
69
|
+
- `EtaConnectionError` -- the device could not be reached (transport
|
|
70
|
+
failure or timeout).
|
|
71
|
+
- `EtaApiError` -- the device returned a non-2xx HTTP response; carries
|
|
72
|
+
`status` and `message`.
|
|
73
|
+
|
|
74
|
+
## CLI
|
|
75
|
+
|
|
76
|
+
An optional recon/debugging CLI is available via `pip install aioetatouch[cli]`:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
aioetatouch --host 192.168.1.50 menu
|
|
80
|
+
aioetatouch --host 192.168.1.50 var /120/10101/0/0/12197
|
|
81
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# aioetatouch
|
|
2
|
+
|
|
3
|
+
Async Python client for the ETAtouch REST API of ETA heating systems.
|
|
4
|
+
|
|
5
|
+
This project is a work in progress. The API surface is not yet stable.
|
|
6
|
+
|
|
7
|
+
Requires Python >=3.12.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install aioetatouch
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
The caller owns the `aiohttp.ClientSession` (the Home Assistant convention);
|
|
18
|
+
`EtaClient` never creates or closes it.
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
import asyncio
|
|
22
|
+
|
|
23
|
+
import aiohttp
|
|
24
|
+
|
|
25
|
+
from aioetatouch import EtaClient
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
async def main() -> None:
|
|
29
|
+
async with aiohttp.ClientSession() as session:
|
|
30
|
+
client = EtaClient("192.168.1.50", session)
|
|
31
|
+
|
|
32
|
+
tree = await client.get_menu()
|
|
33
|
+
for node in tree:
|
|
34
|
+
print(node.uri, node.name)
|
|
35
|
+
|
|
36
|
+
value = await client.get_var("/120/10101/0/0/12197")
|
|
37
|
+
print(f"{value.scaled} {value.unit}")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
asyncio.run(main())
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Read-only, with one caveat
|
|
44
|
+
|
|
45
|
+
`EtaClient` is read-only with respect to variable *values* -- there is no
|
|
46
|
+
method to write a heater's setpoint or state. The one exception is the
|
|
47
|
+
`create_set` / `delete_set` / `add_to_set` / `remove_from_set` methods, which
|
|
48
|
+
intentionally mutate the device's web-service variable-set containers
|
|
49
|
+
(required for bulk polling); they never touch a heater value.
|
|
50
|
+
|
|
51
|
+
### Errors
|
|
52
|
+
|
|
53
|
+
All exceptions inherit from `EtaError`:
|
|
54
|
+
|
|
55
|
+
- `EtaParseError` -- an ETAtouch XML response could not be parsed.
|
|
56
|
+
- `EtaConnectionError` -- the device could not be reached (transport
|
|
57
|
+
failure or timeout).
|
|
58
|
+
- `EtaApiError` -- the device returned a non-2xx HTTP response; carries
|
|
59
|
+
`status` and `message`.
|
|
60
|
+
|
|
61
|
+
## CLI
|
|
62
|
+
|
|
63
|
+
An optional recon/debugging CLI is available via `pip install aioetatouch[cli]`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
aioetatouch --host 192.168.1.50 menu
|
|
67
|
+
aioetatouch --host 192.168.1.50 var /120/10101/0/0/12197
|
|
68
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
Releases are automated with [release-please](https://github.com/googleapis/release-please) and
|
|
4
|
+
published to PyPI via [trusted publishing](https://docs.pypi.org/trusted-publishers/) (no API
|
|
5
|
+
tokens stored anywhere).
|
|
6
|
+
|
|
7
|
+
## Conventional Commits
|
|
8
|
+
|
|
9
|
+
Every commit on `main` must follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
10
|
+
|
|
11
|
+
- `feat: ...` -> minor version bump
|
|
12
|
+
- `fix: ...` -> patch version bump
|
|
13
|
+
- `feat!: ...` / `fix!: ...` / a `BREAKING CHANGE:` footer -> major version bump
|
|
14
|
+
- `chore:`, `docs:`, `refactor:`, `test:`, `ci:`, etc. -> no version bump (still recorded, but not
|
|
15
|
+
released on their own)
|
|
16
|
+
|
|
17
|
+
release-please parses commit history since the last release to determine the next version and to
|
|
18
|
+
generate the changelog. It does not read this repo's changelog by hand — `CHANGELOG.md` is
|
|
19
|
+
entirely owned and written by release-please; do not hand-edit it.
|
|
20
|
+
|
|
21
|
+
## Release flow
|
|
22
|
+
|
|
23
|
+
1. Commits land on `main` via Conventional Commits.
|
|
24
|
+
2. The `Release Please` workflow (`.github/workflows/release-please.yml`) runs on every push to
|
|
25
|
+
`main`. It opens/updates a "release PR" that bumps the version (in
|
|
26
|
+
`src/aioetatouch/__init__.py`, the single source of truth per the `x-release-please-version`
|
|
27
|
+
annotation) and accumulates the changelog.
|
|
28
|
+
3. Merging the release PR makes release-please tag the commit (tag format `X.Y.Z`, no `v` prefix
|
|
29
|
+
per `include-v-in-tag: false`) and create a GitHub Release.
|
|
30
|
+
4. The GitHub Release publish event triggers `.github/workflows/publish.yml`:
|
|
31
|
+
- `build` job: checks out the release tag, runs `uv sync` + `uv run pytest` as a sanity check,
|
|
32
|
+
verifies `aioetatouch.__version__` matches the release tag exactly, then `uv build`s the
|
|
33
|
+
sdist/wheel and uploads them as a workflow artifact.
|
|
34
|
+
- `publish` job: downloads the artifact and publishes it to PyPI with
|
|
35
|
+
`pypa/gh-action-pypi-publish`, authenticating via OIDC trusted publishing under the `pypi`
|
|
36
|
+
GitHub environment. No secrets are configured or required.
|
|
37
|
+
|
|
38
|
+
## First release (0.1.0) bootstrap
|
|
39
|
+
|
|
40
|
+
`aioetatouch` has not been released yet, so there is no prior tag for release-please to diff
|
|
41
|
+
against. Once the repository is pushed to GitHub, bootstrap the first release with an empty commit
|
|
42
|
+
carrying a `Release-As` footer:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
git commit --allow-empty -m "chore: release 0.1.0" -m "Release-As: 0.1.0"
|
|
46
|
+
git push origin main
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This is a one-time manual step; do not perform it as part of routine release automation setup.
|
|
50
|
+
release-please will pick up the `Release-As` footer, open the 0.1.0 release PR, and normal
|
|
51
|
+
automation takes over from there.
|
|
52
|
+
|
|
53
|
+
## One-time manual setup (do before the first release)
|
|
54
|
+
|
|
55
|
+
1. **Create the `pypi` GitHub environment**: repo Settings -> Environments -> New environment ->
|
|
56
|
+
name it `pypi`. (Optionally add protection rules, e.g. required reviewers.)
|
|
57
|
+
2. **Register a PyPI trusted publisher** for this project (on PyPI, under the project's
|
|
58
|
+
"Publishing" settings, or via the pending-publisher flow if the project does not exist yet):
|
|
59
|
+
- Owner: `g4bri3lDev`
|
|
60
|
+
- Repository name: `aioetatouch`
|
|
61
|
+
- Workflow name: `publish.yml`
|
|
62
|
+
- Environment name: `pypi`
|
|
63
|
+
|
|
64
|
+
No PyPI API token is created or stored — publishing is authorized purely via GitHub Actions OIDC
|
|
65
|
+
matching the trusted publisher configuration above.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "aioetatouch"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Async Python client for the ETAtouch REST API of ETA heating systems"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "Apache-2.0"
|
|
11
|
+
requires-python = ">=3.12"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "g4bri3lDev", email = "admin@g4bri3l.de" },
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"aiohttp>=3.9",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[project.optional-dependencies]
|
|
20
|
+
cli = ["rich>=13"]
|
|
21
|
+
|
|
22
|
+
[project.scripts]
|
|
23
|
+
aioetatouch = "aioetatouch.cli:main"
|
|
24
|
+
|
|
25
|
+
[dependency-groups]
|
|
26
|
+
dev = [
|
|
27
|
+
"pytest",
|
|
28
|
+
"pytest-asyncio",
|
|
29
|
+
"pytest-cov",
|
|
30
|
+
"ruff",
|
|
31
|
+
"mypy",
|
|
32
|
+
"rich>=13",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[tool.hatch.version]
|
|
36
|
+
path = "src/aioetatouch/__init__.py"
|
|
37
|
+
|
|
38
|
+
[tool.hatch.build.targets.wheel]
|
|
39
|
+
packages = ["src/aioetatouch"]
|
|
40
|
+
|
|
41
|
+
[tool.ruff]
|
|
42
|
+
line-length = 100
|
|
43
|
+
target-version = "py312"
|
|
44
|
+
|
|
45
|
+
[tool.ruff.lint]
|
|
46
|
+
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF"]
|
|
47
|
+
|
|
48
|
+
[tool.mypy]
|
|
49
|
+
strict = true
|
|
50
|
+
files = "src"
|
|
51
|
+
|
|
52
|
+
[tool.pytest.ini_options]
|
|
53
|
+
asyncio_mode = "auto"
|
|
54
|
+
testpaths = ["tests"]
|
|
55
|
+
|
|
56
|
+
[tool.coverage.run]
|
|
57
|
+
source = ["src/aioetatouch"]
|
|
58
|
+
branch = true
|
|
59
|
+
# __main__.py is a trivial `python -m aioetatouch` shim (import + `raise
|
|
60
|
+
# SystemExit(main())`); it is only ever exercised by launching a subprocess,
|
|
61
|
+
# which isn't worth the cost for a one-liner, so it's omitted rather than
|
|
62
|
+
# unit tested or peppered with pragmas.
|
|
63
|
+
omit = ["src/aioetatouch/__main__.py"]
|
|
64
|
+
|
|
65
|
+
[tool.coverage.report]
|
|
66
|
+
fail_under = 90
|
|
67
|
+
show_missing = true
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""Async Python client for the ETAtouch REST API of ETA heating systems."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .client import EtaClient
|
|
6
|
+
from .exceptions import EtaApiError, EtaConnectionError, EtaError, EtaParseError
|
|
7
|
+
from .models import (
|
|
8
|
+
Envelope,
|
|
9
|
+
ErrorEntry,
|
|
10
|
+
MenuNode,
|
|
11
|
+
MenuTree,
|
|
12
|
+
Value,
|
|
13
|
+
VarInfo,
|
|
14
|
+
VarType,
|
|
15
|
+
)
|
|
16
|
+
from .parser import (
|
|
17
|
+
parse_api_version,
|
|
18
|
+
parse_envelope,
|
|
19
|
+
parse_errors,
|
|
20
|
+
parse_menu,
|
|
21
|
+
parse_value,
|
|
22
|
+
parse_varinfo,
|
|
23
|
+
parse_vars_list,
|
|
24
|
+
parse_vars_set,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__version__ = "0.1.0" # x-release-please-version
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"Envelope",
|
|
31
|
+
"ErrorEntry",
|
|
32
|
+
"EtaApiError",
|
|
33
|
+
"EtaClient",
|
|
34
|
+
"EtaConnectionError",
|
|
35
|
+
"EtaError",
|
|
36
|
+
"EtaParseError",
|
|
37
|
+
"MenuNode",
|
|
38
|
+
"MenuTree",
|
|
39
|
+
"Value",
|
|
40
|
+
"VarInfo",
|
|
41
|
+
"VarType",
|
|
42
|
+
"__version__",
|
|
43
|
+
"parse_api_version",
|
|
44
|
+
"parse_envelope",
|
|
45
|
+
"parse_errors",
|
|
46
|
+
"parse_menu",
|
|
47
|
+
"parse_value",
|
|
48
|
+
"parse_varinfo",
|
|
49
|
+
"parse_vars_list",
|
|
50
|
+
"parse_vars_set",
|
|
51
|
+
]
|