zentraly 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.
Files changed (69) hide show
  1. zentraly-0.1.0/.github/workflows/ci.yml +34 -0
  2. zentraly-0.1.0/.github/workflows/publish.yml +33 -0
  3. zentraly-0.1.0/.gitignore +12 -0
  4. zentraly-0.1.0/CHANGELOG.md +13 -0
  5. zentraly-0.1.0/LICENSE +201 -0
  6. zentraly-0.1.0/LOCAL_DEVELOPMENT.md +81 -0
  7. zentraly-0.1.0/NOTICE +6 -0
  8. zentraly-0.1.0/PKG-INFO +171 -0
  9. zentraly-0.1.0/PUBLIC_API.md +122 -0
  10. zentraly-0.1.0/README.md +143 -0
  11. zentraly-0.1.0/pyproject.toml +41 -0
  12. zentraly-0.1.0/scripts/check_release.py +15 -0
  13. zentraly-0.1.0/src/zentraly/__init__.py +90 -0
  14. zentraly-0.1.0/src/zentraly/client.py +719 -0
  15. zentraly-0.1.0/src/zentraly/commands/__init__.py +5 -0
  16. zentraly-0.1.0/src/zentraly/commands/base.py +64 -0
  17. zentraly-0.1.0/src/zentraly/commands/common.py +201 -0
  18. zentraly-0.1.0/src/zentraly/commands/protocol.py +72 -0
  19. zentraly-0.1.0/src/zentraly/connection.py +549 -0
  20. zentraly-0.1.0/src/zentraly/device.py +286 -0
  21. zentraly-0.1.0/src/zentraly/device_classes/__init__.py +1 -0
  22. zentraly-0.1.0/src/zentraly/device_classes/binary_sensor/__init__.py +1 -0
  23. zentraly-0.1.0/src/zentraly/device_classes/binary_sensor/api.py +224 -0
  24. zentraly-0.1.0/src/zentraly/device_classes/binary_sensor/capabilities.py +12 -0
  25. zentraly-0.1.0/src/zentraly/device_classes/binary_sensor/command_protocols.py +75 -0
  26. zentraly-0.1.0/src/zentraly/device_classes/button/__init__.py +1 -0
  27. zentraly-0.1.0/src/zentraly/device_classes/button/api.py +113 -0
  28. zentraly-0.1.0/src/zentraly/device_classes/button/capabilities.py +10 -0
  29. zentraly-0.1.0/src/zentraly/device_classes/button/command_protocols.py +39 -0
  30. zentraly-0.1.0/src/zentraly/device_classes/climate/__init__.py +1 -0
  31. zentraly-0.1.0/src/zentraly/device_classes/climate/api.py +388 -0
  32. zentraly-0.1.0/src/zentraly/device_classes/climate/capabilities.py +14 -0
  33. zentraly-0.1.0/src/zentraly/device_classes/climate/command_protocols.py +151 -0
  34. zentraly-0.1.0/src/zentraly/device_classes/number/__init__.py +1 -0
  35. zentraly-0.1.0/src/zentraly/device_classes/number/api.py +445 -0
  36. zentraly-0.1.0/src/zentraly/device_classes/number/capabilities.py +18 -0
  37. zentraly-0.1.0/src/zentraly/device_classes/number/command_protocols.py +241 -0
  38. zentraly-0.1.0/src/zentraly/device_classes/select/__init__.py +1 -0
  39. zentraly-0.1.0/src/zentraly/device_classes/select/api.py +358 -0
  40. zentraly-0.1.0/src/zentraly/device_classes/select/capabilities.py +11 -0
  41. zentraly-0.1.0/src/zentraly/device_classes/select/command_protocols.py +60 -0
  42. zentraly-0.1.0/src/zentraly/device_classes/sensor/__init__.py +1 -0
  43. zentraly-0.1.0/src/zentraly/device_classes/sensor/api.py +458 -0
  44. zentraly-0.1.0/src/zentraly/device_classes/sensor/capabilities.py +25 -0
  45. zentraly-0.1.0/src/zentraly/device_classes/sensor/command_protocols.py +257 -0
  46. zentraly-0.1.0/src/zentraly/device_classes/switch/__init__.py +1 -0
  47. zentraly-0.1.0/src/zentraly/device_classes/switch/api.py +612 -0
  48. zentraly-0.1.0/src/zentraly/device_classes/switch/capabilities.py +22 -0
  49. zentraly-0.1.0/src/zentraly/device_classes/switch/command_protocols.py +366 -0
  50. zentraly-0.1.0/src/zentraly/device_classes/types.py +82 -0
  51. zentraly-0.1.0/src/zentraly/devices/__init__.py +37 -0
  52. zentraly-0.1.0/src/zentraly/devices/catalog.py +165 -0
  53. zentraly-0.1.0/src/zentraly/devices/ztbin.py +1161 -0
  54. zentraly-0.1.0/src/zentraly/devices/zteim.py +1561 -0
  55. zentraly-0.1.0/src/zentraly/devices/ztikd.py +485 -0
  56. zentraly-0.1.0/src/zentraly/devices/ztiks.py +485 -0
  57. zentraly-0.1.0/src/zentraly/devices/ztrea.py +926 -0
  58. zentraly-0.1.0/src/zentraly/devices/zttin.py +1119 -0
  59. zentraly-0.1.0/src/zentraly/devices/zttwz.py +1743 -0
  60. zentraly-0.1.0/src/zentraly/exceptions.py +29 -0
  61. zentraly-0.1.0/src/zentraly/py.typed +0 -0
  62. zentraly-0.1.0/src/zentraly/redact.py +15 -0
  63. zentraly-0.1.0/tests/conftest.py +39 -0
  64. zentraly-0.1.0/tests/test_client.py +187 -0
  65. zentraly-0.1.0/tests/test_configuration.py +99 -0
  66. zentraly-0.1.0/tests/test_connection.py +382 -0
  67. zentraly-0.1.0/tests/test_device.py +176 -0
  68. zentraly-0.1.0/tests/test_public_client.py +151 -0
  69. zentraly-0.1.0/tests/test_session.py +70 -0
@@ -0,0 +1,34 @@
1
+ name: Validate library
2
+ on:
3
+ push:
4
+ pull_request:
5
+ workflow_call:
6
+ workflow_dispatch:
7
+ permissions:
8
+ contents: read
9
+ jobs:
10
+ validate:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
14
+ with:
15
+ persist-credentials: false
16
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
17
+ with:
18
+ python-version: '3.14'
19
+ - run: python -m pip install '.[dev]'
20
+ - run: ruff check . && ruff format --check .
21
+ - run: mypy src/zentraly
22
+ - run: pytest --cov=zentraly --cov-branch
23
+ - run: python -m build
24
+ - run: python -m twine check --strict dist/*
25
+ - name: Test the built wheel without Home Assistant
26
+ run: |
27
+ python -m venv /tmp/zentraly-wheel
28
+ /tmp/zentraly-wheel/bin/pip install dist/*.whl pytest pytest-asyncio
29
+ /tmp/zentraly-wheel/bin/python -c "import importlib.util; assert importlib.util.find_spec('homeassistant') is None"
30
+ /tmp/zentraly-wheel/bin/pytest
31
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
32
+ with:
33
+ name: distributions
34
+ path: dist/*
@@ -0,0 +1,33 @@
1
+ name: Publish approved release
2
+ on:
3
+ workflow_dispatch:
4
+ permissions:
5
+ contents: read
6
+ jobs:
7
+ validate:
8
+ uses: ./.github/workflows/ci.yml
9
+ publish:
10
+ needs: validate
11
+ if: startsWith(github.ref, 'refs/tags/v') && vars.PYPI_PUBLISH_ENABLED == 'true'
12
+ runs-on: ubuntu-latest
13
+ environment: pypi
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+ steps:
18
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
19
+ with:
20
+ persist-credentials: false
21
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
22
+ with:
23
+ python-version: '3.14'
24
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
25
+ with:
26
+ name: distributions
27
+ path: dist/
28
+ - name: Verify finalized project and tag
29
+ env:
30
+ EXPECTED_PROJECT: ${{ vars.PYPI_PROJECT_NAME }}
31
+ run: python scripts/check_release.py
32
+ - name: Publish through Trusted Publishing
33
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage*
8
+ coverage.json
9
+ htmlcov/
10
+ build/
11
+ dist/
12
+ *.egg-info/
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 — 2026-09-16
4
+
5
+ - Extract Zentraly transport, client, commands, device catalog, runtime and
6
+ capability APIs from Home Assistant without changing the device protocol.
7
+ - Support caller-owned aiohttp sessions and independent credential redaction.
8
+ - Move communication and model configuration regression tests out of HA.
9
+ - Prepare typed wheels, source distributions, independent CI and guarded release.
10
+ - Define root exports for capability APIs/enums, types, model helpers and errors;
11
+ preserve existing module imports and class identity.
12
+ - Document units, errors/results, listener/session lifecycle and compatibility
13
+ policy in PUBLIC_API.md; choose zentraly as the package name.
zentraly-0.1.0/LICENSE ADDED
@@ -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 the
141
+ 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 [yyyy] [name of copyright owner]
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
+ # Development with the Zentraly workspace
2
+
3
+ The library repository is `https://github.com/zentralySAU/zentraly-python`.
4
+ Distribution and import name: `zentraly`. The first release version is `0.1.0`.
5
+
6
+ Use independent sibling checkouts:
7
+
8
+ ```text
9
+ /workspaces/
10
+ Zentraly/ # Home Assistant Core fork
11
+ zentraly-python/ # This repository
12
+ zentraly-documentos/ # Private Spanish manuals, Excel and context
13
+ brands/
14
+ home-assistant.io/
15
+ zentraly.code-workspace
16
+ ```
17
+
18
+ Open `zentraly.code-workspace` in VS Code to work on all five. Each repository
19
+ retains its own history, branch, commits and remote. Never add the library or
20
+ manuals to the Core repository. `brands` and `home-assistant.io` are also included in the workspace.
21
+
22
+ ## Python environments
23
+
24
+ The library has its own `.venv` without Home Assistant:
25
+
26
+ ```sh
27
+ python3 -m venv .venv
28
+ .venv/bin/python3 -m pip install -e '.[dev]'
29
+ .venv/bin/python3 -m pytest
30
+ .venv/bin/ruff check .
31
+ .venv/bin/ruff format --check .
32
+ .venv/bin/mypy src/zentraly
33
+ ```
34
+
35
+ Set up the Core environment with its `script/setup` instructions, then install
36
+ this library editable into that environment. From the Core checkout, in the
37
+ current workspace:
38
+
39
+ ```sh
40
+ uv pip install --python /home/vscode/.local/ha-venv/bin/python3 --no-deps -e ../zentraly-python
41
+ UV_PROJECT_ENVIRONMENT=/home/vscode/.local/ha-venv uv run --no-sync pytest tests/components/zentraly -q
42
+ UV_PROJECT_ENVIRONMENT=/home/vscode/.local/ha-venv uv run --no-sync python3 -m script.hassfest --action validate --integration-path homeassistant/components/zentraly
43
+ ```
44
+
45
+ The editable install points directly at this checkout. Moving it requires
46
+ reinstalling it; virtual environments also need recreation after a path change.
47
+ The machine-specific HA environment path above is not a package requirement.
48
+ Keep the HA extraction PR in draft until the release is available from PyPI, its
49
+ manifest pins that version and the generated dependency files are included.
50
+ An editable install is useful for development but cannot validate PyPI delivery.
51
+
52
+ ## Ownership and contracts
53
+
54
+ The active maintainer account is zentralySAU. PUBLIC_API.md defines supported
55
+ root imports, results/errors, semantic units and lifecycle. HA owns its shared
56
+ session; the library closes only sessions it creates. Protocol/model behavior
57
+ is unchanged by extraction or workspace relocation.
58
+
59
+ ## Tests and release
60
+
61
+ The extraction retained 270 existing cases across HA and the library; six new
62
+ library cases bring the totals to 190 HA and 86 library tests. The user confirmed
63
+ physical tests for the extraction; model/firmware coverage was not specified.
64
+ Build and test the wheel in a clean environment before releases. README.md
65
+ explains the guarded release workflow; repository creation/push is not PyPI
66
+ publication. Finalize the reviewed release version and Trusted Publisher first.
67
+
68
+ Core's generated requirements need a reviewed update once a published version
69
+ is selected. The prior local omission is recorded in the draft PR; it is not a
70
+ permanent exemption from Core's dependency checks.
71
+
72
+ ## Documentation and recovery
73
+
74
+ Private documentation is in `../zentraly-documentos/`; it is not needed to build,
75
+ install or use the library. Its generator takes explicit Core/library paths and
76
+ its logo resides inside that repository. See its README.md for compilation.
77
+
78
+ The stable pre-extraction tag remains in Core:
79
+ `zentraly-stable-before-library-2026-09-16`. The library has an independent Git
80
+ history. Back up both repositories and the documentation; a Core commit alone
81
+ does not include the other two projects.
zentraly-0.1.0/NOTICE ADDED
@@ -0,0 +1,6 @@
1
+ This package was extracted from the Zentraly integration developed in the
2
+ Home Assistant Core fork https://github.com/diazmanuel/Zentraly.
3
+ Baseline: 4d254fd7a55021d974a5b27fa873e043aae76aeb.
4
+ Home Assistant Core is distributed under the Apache License, Version 2.0.
5
+ Existing copyright and license notices remain applicable.
6
+ Package: zentraly. Repository: https://github.com/zentralySAU/zentraly-python.
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.5
2
+ Name: zentraly
3
+ Version: 0.1.0
4
+ Summary: Asynchronous client for the Zentraly device protocol
5
+ Project-URL: Repository, https://github.com/zentralySAU/zentraly-python
6
+ Project-URL: Issues, https://github.com/zentralySAU/zentraly-python/issues
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Classifier: Framework :: AsyncIO
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Requires-Python: >=3.14
14
+ Requires-Dist: aiohttp<4,>=3.13
15
+ Provides-Extra: dev
16
+ Requires-Dist: build; extra == 'dev'
17
+ Requires-Dist: mypy; extra == 'dev'
18
+ Requires-Dist: pytest-asyncio>=1; extra == 'dev'
19
+ Requires-Dist: pytest-cov>=6; extra == 'dev'
20
+ Requires-Dist: pytest>=8; extra == 'dev'
21
+ Requires-Dist: ruff; extra == 'dev'
22
+ Requires-Dist: twine; extra == 'dev'
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest-asyncio>=1; extra == 'test'
25
+ Requires-Dist: pytest-cov>=6; extra == 'test'
26
+ Requires-Dist: pytest>=8; extra == 'test'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Zentraly Python client
30
+
31
+ Independent asynchronous device library extracted from the Zentraly integration.
32
+ The distribution and import name are zentraly. The repository owner is zentralySAU.
33
+ The first release is 0.1.0.
34
+ Python 3.14 or newer is required. No Home Assistant dependency.
35
+
36
+ ## Installation
37
+
38
+ ```sh
39
+ python3 -m pip install zentraly==0.1.0
40
+ ```
41
+
42
+ ## Development
43
+
44
+ ```sh
45
+ python3 -m venv .venv
46
+ .venv/bin/python3 -m pip install -e '.[dev]'
47
+ .venv/bin/pytest
48
+ .venv/bin/ruff check .
49
+ .venv/bin/ruff format --check .
50
+ .venv/bin/mypy src/zentraly
51
+ .venv/bin/python3 -m build
52
+ .venv/bin/python3 -m twine check --strict dist/*
53
+ ```
54
+
55
+ The `src` layout ensures tests use the installed package. The CI additionally
56
+ installs the built wheel into a fresh environment and reruns the tests without HA.
57
+ `py.typed` is included. Tests require no real device and do not send commands to hardware.
58
+
59
+ ## Public API
60
+
61
+ ```python
62
+ import asyncio
63
+ import os
64
+
65
+ from aiohttp import ClientSession
66
+ from zentraly import ZentralyApi, ZentralyNumberApi, create_device
67
+
68
+
69
+ async def main():
70
+ async with ClientSession() as session:
71
+ client = ZentralyApi(
72
+ os.environ["ZENTRALY_HOST"],
73
+ 80,
74
+ os.environ["ZENTRALY_PASSWORD"],
75
+ os.environ["ZENTRALY_DEVICE_ID"],
76
+ session=session,
77
+ )
78
+ # Temporary authentication and model-specific MAC discovery.
79
+ mac = await client.async_validate_password()
80
+ device = create_device(client, client.device_id, mac)
81
+ number = ZentralyNumberApi(device)
82
+ connected = asyncio.Event()
83
+ remove_connection = client.add_connection_state_listener(
84
+ lambda online: connected.set() if online else connected.clear()
85
+ )
86
+ remove_updates = number.add_state_listener(print)
87
+ try:
88
+ # Starts a background reconnect loop; does not wait for a login.
89
+ await client.async_connect()
90
+ await asyncio.wait_for(connected.wait(), timeout=30)
91
+ print(await number.async_get_temperature_offset())
92
+ # An explicit write, only if the application requests it:
93
+ # await number.async_set_temperature_offset(-1.2)
94
+ finally:
95
+ remove_updates()
96
+ remove_connection()
97
+ await client.async_disconnect()
98
+
99
+
100
+ asyncio.run(main())
101
+ ```
102
+
103
+ Capability enums and command contracts live under `zentraly.device_classes`.
104
+ Device implementations and topology live under `zentraly.devices`; catalog
105
+ helpers are in `zentraly.devices.catalog`. The root exports client/runtime, capability APIs/enums, semantic types, model
106
+ helpers and errors. Use these imports; see [PUBLIC_API.md](PUBLIC_API.md) for the
107
+ compatibility and lifecycle contract. Home Assistant entity classes are not part of this package.
108
+
109
+ Children use `create_device(parent_client, child_id, child_mac)` and share the
110
+ parent connection. `async_validate_child_device` validates them on that connection;
111
+ applications must also enforce catalog parent/child compatibility and limits.
112
+ Number/select/switch APIs accept `endpoint=` for supported channels. Reports retain
113
+ MAC and endpoint, and missing attributes do not erase previously received fields.
114
+
115
+ Read helpers may return `None` when no valid response is available. Action failures
116
+ raise exceptions from `zentraly.exceptions`; UI translation belongs to the caller.
117
+ The raw `async_execute_command(builder)` returns `(rid, response)` or `None`.
118
+ Listener registration returns an unsubscribe callable. Unsubscribe and disconnect
119
+ on shutdown. No background work starts merely by importing or creating a device.
120
+
121
+ A supplied `ClientSession` remains owned by its caller, including on failed
122
+ validation, reconnect and disconnect. Without injection, transports create and
123
+ close their own sessions. HA always supplies its shared session.
124
+
125
+ ## Preserved behavior
126
+
127
+ - 20 in-flight requests per physical connection; FIFO wait, warning at capacity.
128
+ - Response timeout 30 seconds; maximum queue wait 60 seconds.
129
+ - Queue threshold 10 logs an error but does not reject requests by queue size.
130
+ - Keepalive uses the same queue, with no priority. Disconnect resolves outstanding
131
+ requests without replaying them on the next connection.
132
+ - Device models preserve scales, ranges, independent implementations and action
133
+ sequences. Display dependencies expose control availability; they do not add a
134
+ new protocol write restriction.
135
+ - HA owns entity refresh scheduling, registry data, entity names, UI categories,
136
+ unit constants, translations and timer presentation.
137
+
138
+ ## Releasing
139
+
140
+ The GitHub Actions workflow `publish.yml` uses PyPI Trusted Publishing. The `pypi`
141
+ environment requires release approval and accepts version tags. Repository
142
+ variables are `PYPI_PROJECT_NAME=zentraly` and `PYPI_PUBLISH_ENABLED=true`.
143
+
144
+ 1. Update pyproject.toml and CHANGELOG.md for the reviewed release.
145
+ 2. Run library and HA tests, type/format checks, build and strict Twine validation.
146
+ Build into an empty output directory so previous versions are not uploaded.
147
+ 3. Commit the reviewed release and tag it as `v<version>`.
148
+ 4. Dispatch `publish.yml` manually against that tag. CI must pass before publishing;
149
+ approve the `pypi` environment deployment for the reviewed commit.
150
+ 5. Verify the PyPI files and install the published version in a clean environment.
151
+ 6. Pin the published release in HA, regenerate dependency files and validate CI.
152
+
153
+ The release guard checks project name, repository URL and tag/version agreement;
154
+ it rejects the former local version 0.0.0.dev0. No API token is stored in this
155
+ repository. A TestPyPI rehearsal needs separate configuration; this workflow
156
+ publishes to production PyPI. Never replace a version already uploaded to PyPI.
157
+
158
+ ## Project status and ownership
159
+
160
+ The user has reported successful physical-device tests after extraction; model
161
+ and firmware coverage were not specified. Automated evidence remains 190 HA
162
+ cases and 86 standalone library cases, also verified against built wheels.
163
+
164
+ The HA fork belongs to zentralySAU. This library lives in the separate
165
+ zentraly-python repository; its sibling zentraly-documentos contains private
166
+ documentation and the Excel. Neither is included in a Core push. See
167
+ LOCAL_DEVELOPMENT.md for the multi-repository workspace and editable installation.
168
+
169
+ Root imports, results, errors, units and listener/session lifecycle are documented
170
+ in PUBLIC_API.md. Existing module imports remain available in this change.
171
+ This Python API requires no HTTP server or Home Assistant.