pytriplesolar 0.1.0a1__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.
@@ -0,0 +1,75 @@
1
+ name: Release
2
+
3
+ # Publishes to PyPI when a GitHub release is published. The release tag must
4
+ # be "v" + the version in pyproject.toml (e.g. v0.1.0a1).
5
+ on:
6
+ release:
7
+ types: [published]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ name: Test (Python ${{ matrix.python-version }})
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ matrix:
18
+ python-version: ["3.13", "3.14"]
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+ - name: Install
25
+ run: python -m pip install -e ".[test]" ruff mypy
26
+ - name: Lint
27
+ run: |
28
+ ruff check .
29
+ ruff format --check .
30
+ mypy src tests
31
+ - name: Test
32
+ run: pytest
33
+
34
+ build:
35
+ name: Build distributions
36
+ needs: test
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - uses: actions/checkout@v4
40
+ - uses: actions/setup-python@v5
41
+ with:
42
+ python-version: "3.13"
43
+ - name: Check tag matches version
44
+ env:
45
+ TAG: ${{ github.event.release.tag_name }}
46
+ run: |
47
+ version=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
48
+ if [ "$TAG" != "v$version" ]; then
49
+ echo "::error::Release tag $TAG does not match pyproject version v$version"
50
+ exit 1
51
+ fi
52
+ - name: Build
53
+ run: |
54
+ python -m pip install build
55
+ python -m build
56
+ - uses: actions/upload-artifact@v4
57
+ with:
58
+ name: dist
59
+ path: dist/
60
+
61
+ publish:
62
+ name: Publish to PyPI
63
+ needs: build
64
+ runs-on: ubuntu-latest
65
+ environment:
66
+ name: pypi
67
+ url: https://pypi.org/p/pytriplesolar
68
+ permissions:
69
+ id-token: write # trusted publishing (OIDC), no API token needed
70
+ steps:
71
+ - uses: actions/download-artifact@v4
72
+ with:
73
+ name: dist
74
+ path: dist/
75
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,8 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .ruff_cache/
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,150 @@
1
+ Metadata-Version: 2.5
2
+ Name: pytriplesolar
3
+ Version: 0.1.0a1
4
+ Summary: Async library for Triple Solar PVT heat pumps over Modbus/TLS.
5
+ Project-URL: Homepage, https://github.com/florianschut/pytriplesolar
6
+ Project-URL: Issues, https://github.com/florianschut/pytriplesolar/issues
7
+ Author: Florian Schut
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: heat-pump,modbus,modbus-tls,pvt,triple-solar
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Framework :: AsyncIO
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Home Automation
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.13
21
+ Requires-Dist: aiohttp>=3.11
22
+ Requires-Dist: cryptography>=44
23
+ Requires-Dist: modbus-connection<5,>=4.12.7
24
+ Provides-Extra: test
25
+ Requires-Dist: modbus-connection[tmodbus]<5,>=4.12.7; extra == 'test'
26
+ Requires-Dist: pytest-asyncio>=0.25; extra == 'test'
27
+ Requires-Dist: pytest>=8; extra == 'test'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # pytriplesolar
31
+
32
+ Asynchronous Python library for the **Triple Solar PVT Heat Pump 5.0**, over
33
+ Modbus/TLS.
34
+
35
+ It is built on [`modbus-connection`](https://pypi.org/project/modbus-connection/):
36
+ the library describes the heat pump's registers as typed components and takes a
37
+ `ModbusUnit`. It never opens a connection itself, so the application decides
38
+ how and when to connect, and can share one connection between users.
39
+
40
+ ## Requirements
41
+
42
+ - Python 3.13+
43
+ - A Triple Solar heat pump with Modbus TCP set to *secure* (the default), on
44
+ the same network. Discovery uses mDNS, which does not cross routers or VLANs.
45
+
46
+ ## Pairing
47
+
48
+ Modbus/TLS uses mutual certificate authentication. A client pairs once to get
49
+ a certificate signed by the heat pump's own root CA:
50
+
51
+ 1. Enable pairing mode in the My Triple Solar app. The heat pump then runs a
52
+ single-use signing service for one minute, announced over mDNS-SD as
53
+ `_ts-csr._tcp`.
54
+ 2. Browse for that service with your zeroconf library of choice. Then pass its
55
+ address, port and host name to `async_pair`:
56
+
57
+ ```python
58
+ import aiohttp
59
+ from pytriplesolar import async_pair
60
+
61
+ async with aiohttp.ClientSession() as session:
62
+ credentials = await async_pair(
63
+ session, "192.0.2.10", 6509, device_hostname="hpcb-a1b2c3.local"
64
+ )
65
+ ```
66
+
67
+ `Credentials` holds the root CA, the client certificate and key (PEM), plus the
68
+ host name the heat pump was paired under. Store it with `as_dict()` and restore
69
+ it with `Credentials.from_dict()`. It contains a private key, so keep it
70
+ private.
71
+
72
+ ## Reading and writing
73
+
74
+ Find the paired heat pump's `_mbap-s._tcp` service (port 802), then connect
75
+ with the credentials:
76
+
77
+ ```python
78
+ from pathlib import Path
79
+
80
+ from modbus_connection.tmodbus import connect_tls
81
+ from pytriplesolar import Profile, SpaceConditioningMode, TripleSolarHeatPump
82
+
83
+ files = credentials.write_files(Path("certs")) # blocking: ssl needs files
84
+ params = files.tls_params("192.0.2.10")
85
+
86
+ connection = await connect_tls(
87
+ params.host,
88
+ port=params.port,
89
+ verify=params.verify,
90
+ check_hostname=params.check_hostname,
91
+ client_cert=params.client_cert,
92
+ client_key=params.client_key,
93
+ )
94
+ heat_pump = TripleSolarHeatPump(connection.for_unit(1))
95
+
96
+ report = await heat_pump.async_update()
97
+ print(heat_pump.general.state, [str(a) for a in heat_pump.alerts.active])
98
+ print(heat_pump.dhw.tank_temperature, heat_pump.heat_pump_module_1.electric_power)
99
+
100
+ await heat_pump.settings.write("dhw_profile", Profile.COMFORT)
101
+ await heat_pump.dhw_comfort.write("tank_temperature_setpoint", 55.0)
102
+ await heat_pump.control.write("mode", SpaceConditioningMode.HEATING)
103
+ ```
104
+
105
+ The server certificate is verified against the heat pump's root CA. That CA is
106
+ unique to the unit, so the connection is pinned to the paired heat pump. The
107
+ host name is not checked, because the heat pump is normally reached by IP.
108
+
109
+ ## Sub-systems
110
+
111
+ | Attribute | Registers | Contents |
112
+ | --- | --- | --- |
113
+ | `general` | input | overall state, total rated power |
114
+ | `alerts` | input | up to 20 active alerts, decoded to service codes (`F10203`) |
115
+ | `dhw` | input | DHW state, demand, modulation, tank temperature and setpoint, valve, active profile |
116
+ | `space_heating` / `space_cooling` | input | state, demand, modulation, sink supply temperature and setpoint |
117
+ | `space_conditioning_input` | input | room/ambient temperature, humidity, room setpoint, thermostat modulation |
118
+ | `heat_pump_module_1` / `_2` | input | module state, compressor frequency, pumps, cooling valve, source/sink temperatures, electric/thermal power, compressor starts |
119
+ | `settings` | holding (R/W) | space heating / cooling / DHW enabled and profile |
120
+ | `dhw_eco` / `dhw_normal` / `dhw_comfort` | holding (R/W) | tank setpoint (10–70 °C), lower hysteresis (0–50 °C), modulation (20–100 %) per DHW profile |
121
+ | `control` | holding (R/W) | external control: mode, modulation level (0–100 %), power budget (W) |
122
+
123
+ `heat_pump_module_2` is `None` on a unit with a single module (detected on the
124
+ first update).
125
+
126
+ Values the heat pump does not currently have (for example, no room thermostat
127
+ connected) read as `None`. The heat pump refuses a whole block of registers as
128
+ soon as one value in it is missing, so the library then re-reads that
129
+ sub-system one register at a time.
130
+
131
+ ### External control
132
+
133
+ The `control` registers live in memory only. The heat pump acts on them only
134
+ while a Modbus client has been active within the last 30 seconds
135
+ (`CONTROL_KEEPALIVE_SECONDS`). Poll faster than that while controlling it.
136
+
137
+ ## Development
138
+
139
+ ```sh
140
+ python -m venv .venv
141
+ .venv/bin/pip install -e ".[test]"
142
+ .venv/bin/pytest
143
+ ```
144
+
145
+ Tests run against `modbus-connection`'s in-memory mock unit via its pytest
146
+ plugin (`mock_modbus_unit` fixture), so no hardware is needed.
147
+
148
+ ## License
149
+
150
+ Apache-2.0
@@ -0,0 +1,121 @@
1
+ # pytriplesolar
2
+
3
+ Asynchronous Python library for the **Triple Solar PVT Heat Pump 5.0**, over
4
+ Modbus/TLS.
5
+
6
+ It is built on [`modbus-connection`](https://pypi.org/project/modbus-connection/):
7
+ the library describes the heat pump's registers as typed components and takes a
8
+ `ModbusUnit`. It never opens a connection itself, so the application decides
9
+ how and when to connect, and can share one connection between users.
10
+
11
+ ## Requirements
12
+
13
+ - Python 3.13+
14
+ - A Triple Solar heat pump with Modbus TCP set to *secure* (the default), on
15
+ the same network. Discovery uses mDNS, which does not cross routers or VLANs.
16
+
17
+ ## Pairing
18
+
19
+ Modbus/TLS uses mutual certificate authentication. A client pairs once to get
20
+ a certificate signed by the heat pump's own root CA:
21
+
22
+ 1. Enable pairing mode in the My Triple Solar app. The heat pump then runs a
23
+ single-use signing service for one minute, announced over mDNS-SD as
24
+ `_ts-csr._tcp`.
25
+ 2. Browse for that service with your zeroconf library of choice. Then pass its
26
+ address, port and host name to `async_pair`:
27
+
28
+ ```python
29
+ import aiohttp
30
+ from pytriplesolar import async_pair
31
+
32
+ async with aiohttp.ClientSession() as session:
33
+ credentials = await async_pair(
34
+ session, "192.0.2.10", 6509, device_hostname="hpcb-a1b2c3.local"
35
+ )
36
+ ```
37
+
38
+ `Credentials` holds the root CA, the client certificate and key (PEM), plus the
39
+ host name the heat pump was paired under. Store it with `as_dict()` and restore
40
+ it with `Credentials.from_dict()`. It contains a private key, so keep it
41
+ private.
42
+
43
+ ## Reading and writing
44
+
45
+ Find the paired heat pump's `_mbap-s._tcp` service (port 802), then connect
46
+ with the credentials:
47
+
48
+ ```python
49
+ from pathlib import Path
50
+
51
+ from modbus_connection.tmodbus import connect_tls
52
+ from pytriplesolar import Profile, SpaceConditioningMode, TripleSolarHeatPump
53
+
54
+ files = credentials.write_files(Path("certs")) # blocking: ssl needs files
55
+ params = files.tls_params("192.0.2.10")
56
+
57
+ connection = await connect_tls(
58
+ params.host,
59
+ port=params.port,
60
+ verify=params.verify,
61
+ check_hostname=params.check_hostname,
62
+ client_cert=params.client_cert,
63
+ client_key=params.client_key,
64
+ )
65
+ heat_pump = TripleSolarHeatPump(connection.for_unit(1))
66
+
67
+ report = await heat_pump.async_update()
68
+ print(heat_pump.general.state, [str(a) for a in heat_pump.alerts.active])
69
+ print(heat_pump.dhw.tank_temperature, heat_pump.heat_pump_module_1.electric_power)
70
+
71
+ await heat_pump.settings.write("dhw_profile", Profile.COMFORT)
72
+ await heat_pump.dhw_comfort.write("tank_temperature_setpoint", 55.0)
73
+ await heat_pump.control.write("mode", SpaceConditioningMode.HEATING)
74
+ ```
75
+
76
+ The server certificate is verified against the heat pump's root CA. That CA is
77
+ unique to the unit, so the connection is pinned to the paired heat pump. The
78
+ host name is not checked, because the heat pump is normally reached by IP.
79
+
80
+ ## Sub-systems
81
+
82
+ | Attribute | Registers | Contents |
83
+ | --- | --- | --- |
84
+ | `general` | input | overall state, total rated power |
85
+ | `alerts` | input | up to 20 active alerts, decoded to service codes (`F10203`) |
86
+ | `dhw` | input | DHW state, demand, modulation, tank temperature and setpoint, valve, active profile |
87
+ | `space_heating` / `space_cooling` | input | state, demand, modulation, sink supply temperature and setpoint |
88
+ | `space_conditioning_input` | input | room/ambient temperature, humidity, room setpoint, thermostat modulation |
89
+ | `heat_pump_module_1` / `_2` | input | module state, compressor frequency, pumps, cooling valve, source/sink temperatures, electric/thermal power, compressor starts |
90
+ | `settings` | holding (R/W) | space heating / cooling / DHW enabled and profile |
91
+ | `dhw_eco` / `dhw_normal` / `dhw_comfort` | holding (R/W) | tank setpoint (10–70 °C), lower hysteresis (0–50 °C), modulation (20–100 %) per DHW profile |
92
+ | `control` | holding (R/W) | external control: mode, modulation level (0–100 %), power budget (W) |
93
+
94
+ `heat_pump_module_2` is `None` on a unit with a single module (detected on the
95
+ first update).
96
+
97
+ Values the heat pump does not currently have (for example, no room thermostat
98
+ connected) read as `None`. The heat pump refuses a whole block of registers as
99
+ soon as one value in it is missing, so the library then re-reads that
100
+ sub-system one register at a time.
101
+
102
+ ### External control
103
+
104
+ The `control` registers live in memory only. The heat pump acts on them only
105
+ while a Modbus client has been active within the last 30 seconds
106
+ (`CONTROL_KEEPALIVE_SECONDS`). Poll faster than that while controlling it.
107
+
108
+ ## Development
109
+
110
+ ```sh
111
+ python -m venv .venv
112
+ .venv/bin/pip install -e ".[test]"
113
+ .venv/bin/pytest
114
+ ```
115
+
116
+ Tests run against `modbus-connection`'s in-memory mock unit via its pytest
117
+ plugin (`mock_modbus_unit` fixture), so no hardware is needed.
118
+
119
+ ## License
120
+
121
+ Apache-2.0
@@ -0,0 +1,66 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "pytriplesolar"
7
+ version = "0.1.0a1"
8
+ description = "Async library for Triple Solar PVT heat pumps over Modbus/TLS."
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE"]
12
+ authors = [{ name = "Florian Schut" }]
13
+ requires-python = ">=3.13"
14
+ keywords = ["heat-pump", "modbus", "modbus-tls", "triple-solar", "pvt"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Framework :: AsyncIO",
18
+ "Intended Audience :: Developers",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Topic :: Home Automation",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = [
27
+ "aiohttp>=3.11",
28
+ "cryptography>=44",
29
+ "modbus-connection>=4.12.7,<5",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/florianschut/pytriplesolar"
34
+ Issues = "https://github.com/florianschut/pytriplesolar/issues"
35
+
36
+ [project.optional-dependencies]
37
+ test = [
38
+ "modbus-connection[tmodbus]>=4.12.7,<5",
39
+ "pytest>=8",
40
+ "pytest-asyncio>=0.25",
41
+ ]
42
+
43
+ [tool.hatch.build.targets.wheel]
44
+ packages = ["src/pytriplesolar"]
45
+
46
+ [tool.pytest.ini_options]
47
+ asyncio_mode = "auto"
48
+ asyncio_default_fixture_loop_scope = "function"
49
+ testpaths = ["tests"]
50
+ filterwarnings = ["error"]
51
+
52
+ [tool.ruff]
53
+ target-version = "py313"
54
+ src = ["src", "tests"]
55
+
56
+ [tool.ruff.lint]
57
+ select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF", "D", "ASYNC", "PT", "TID"]
58
+ ignore = ["D203", "D213", "D401"]
59
+
60
+ [tool.ruff.lint.per-file-ignores]
61
+ "tests/**" = ["D"]
62
+
63
+ [tool.mypy]
64
+ python_version = "3.13"
65
+ strict = true
66
+ mypy_path = "src"