pymacon 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.
- pymacon-0.1.0/LICENSE +21 -0
- pymacon-0.1.0/PKG-INFO +86 -0
- pymacon-0.1.0/README.md +57 -0
- pymacon-0.1.0/pyproject.toml +60 -0
- pymacon-0.1.0/setup.cfg +4 -0
- pymacon-0.1.0/src/pymacon/__init__.py +88 -0
- pymacon-0.1.0/src/pymacon/client.py +867 -0
- pymacon-0.1.0/src/pymacon/exceptions.py +37 -0
- pymacon-0.1.0/src/pymacon/models.py +465 -0
- pymacon-0.1.0/src/pymacon/py.typed +0 -0
- pymacon-0.1.0/src/pymacon.egg-info/PKG-INFO +86 -0
- pymacon-0.1.0/src/pymacon.egg-info/SOURCES.txt +15 -0
- pymacon-0.1.0/src/pymacon.egg-info/dependency_links.txt +1 -0
- pymacon-0.1.0/src/pymacon.egg-info/requires.txt +10 -0
- pymacon-0.1.0/src/pymacon.egg-info/top_level.txt +1 -0
- pymacon-0.1.0/tests/test_client.py +374 -0
- pymacon-0.1.0/tests/test_hardware.py +81 -0
pymacon-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Stefan Slivinski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pymacon-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pymacon
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Async local client for the Macon Heat Pump Controller
|
|
5
|
+
Author: Stefan Slivinski
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/sslivins/pymacon
|
|
8
|
+
Project-URL: Issues, https://github.com/sslivins/pymacon/issues
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Home Automation
|
|
16
|
+
Requires-Python: >=3.11
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: aiohttp>=3.11
|
|
20
|
+
Requires-Dist: yarl>=1.9
|
|
21
|
+
Provides-Extra: tests
|
|
22
|
+
Requires-Dist: cryptography>=42; extra == "tests"
|
|
23
|
+
Requires-Dist: mypy>=1.10; extra == "tests"
|
|
24
|
+
Requires-Dist: pytest>=7; extra == "tests"
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "tests"
|
|
26
|
+
Requires-Dist: pytest-cov>=5; extra == "tests"
|
|
27
|
+
Requires-Dist: ruff>=0.6; extra == "tests"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# pymacon
|
|
31
|
+
|
|
32
|
+
Secure async REST and WebSocket client for the
|
|
33
|
+
**Macon Heat Pump Controller**. It is the transport library used by the
|
|
34
|
+
[Macon Home Assistant integration](https://github.com/sslivins/hass-macon).
|
|
35
|
+
|
|
36
|
+
Each `MaconClient` owns the credential, pinned certificate,
|
|
37
|
+
ordered state, reconnect loop, and reconciliation state for exactly one
|
|
38
|
+
controller. Multiple controllers therefore remain fully isolated.
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install pymacon
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from pymacon import MaconClient
|
|
50
|
+
|
|
51
|
+
client = MaconClient(
|
|
52
|
+
"192.168.1.21",
|
|
53
|
+
token,
|
|
54
|
+
certificate_fingerprint,
|
|
55
|
+
# arctic-* is retained because it is the firmware wire-format ID.
|
|
56
|
+
device_id="arctic-001122334455",
|
|
57
|
+
)
|
|
58
|
+
client.subscribe(handle_snapshot)
|
|
59
|
+
client.subscribe_status(handle_status)
|
|
60
|
+
await client.start()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Call `await client.stop()` when unloading the owning config entry. Sessions
|
|
64
|
+
passed into the constructor remain owned by the caller; sessions created by
|
|
65
|
+
the client are closed automatically.
|
|
66
|
+
|
|
67
|
+
Control methods acknowledge that a command was accepted, but they never
|
|
68
|
+
optimistically mutate local state. Subscribe to snapshots to observe the
|
|
69
|
+
controller's reported state:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
await client.async_set_cooling_setpoint(12)
|
|
73
|
+
await client.async_set_power(False)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Only controls advertised by `client.capabilities` should be called. The
|
|
77
|
+
firmware rejects unavailable, unsafe, or unsupported operations.
|
|
78
|
+
|
|
79
|
+
## Development
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
python -m pip install -e ".[tests]"
|
|
83
|
+
pytest
|
|
84
|
+
ruff check src tests
|
|
85
|
+
mypy src
|
|
86
|
+
```
|
pymacon-0.1.0/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# pymacon
|
|
2
|
+
|
|
3
|
+
Secure async REST and WebSocket client for the
|
|
4
|
+
**Macon Heat Pump Controller**. It is the transport library used by the
|
|
5
|
+
[Macon Home Assistant integration](https://github.com/sslivins/hass-macon).
|
|
6
|
+
|
|
7
|
+
Each `MaconClient` owns the credential, pinned certificate,
|
|
8
|
+
ordered state, reconnect loop, and reconciliation state for exactly one
|
|
9
|
+
controller. Multiple controllers therefore remain fully isolated.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install pymacon
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from pymacon import MaconClient
|
|
21
|
+
|
|
22
|
+
client = MaconClient(
|
|
23
|
+
"192.168.1.21",
|
|
24
|
+
token,
|
|
25
|
+
certificate_fingerprint,
|
|
26
|
+
# arctic-* is retained because it is the firmware wire-format ID.
|
|
27
|
+
device_id="arctic-001122334455",
|
|
28
|
+
)
|
|
29
|
+
client.subscribe(handle_snapshot)
|
|
30
|
+
client.subscribe_status(handle_status)
|
|
31
|
+
await client.start()
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Call `await client.stop()` when unloading the owning config entry. Sessions
|
|
35
|
+
passed into the constructor remain owned by the caller; sessions created by
|
|
36
|
+
the client are closed automatically.
|
|
37
|
+
|
|
38
|
+
Control methods acknowledge that a command was accepted, but they never
|
|
39
|
+
optimistically mutate local state. Subscribe to snapshots to observe the
|
|
40
|
+
controller's reported state:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
await client.async_set_cooling_setpoint(12)
|
|
44
|
+
await client.async_set_power(False)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Only controls advertised by `client.capabilities` should be called. The
|
|
48
|
+
firmware rejects unavailable, unsafe, or unsupported operations.
|
|
49
|
+
|
|
50
|
+
## Development
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
python -m pip install -e ".[tests]"
|
|
54
|
+
pytest
|
|
55
|
+
ruff check src tests
|
|
56
|
+
mypy src
|
|
57
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pymacon"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Async local client for the Macon Heat Pump Controller"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Stefan Slivinski" },
|
|
14
|
+
]
|
|
15
|
+
requires-python = ">=3.11"
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Home Automation",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"aiohttp>=3.11",
|
|
27
|
+
"yarl>=1.9",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://github.com/sslivins/pymacon"
|
|
32
|
+
Issues = "https://github.com/sslivins/pymacon/issues"
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
tests = [
|
|
36
|
+
"cryptography>=42",
|
|
37
|
+
"mypy>=1.10",
|
|
38
|
+
"pytest>=7",
|
|
39
|
+
"pytest-asyncio>=0.23",
|
|
40
|
+
"pytest-cov>=5",
|
|
41
|
+
"ruff>=0.6",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["src"]
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.package-data]
|
|
48
|
+
pymacon = ["py.typed"]
|
|
49
|
+
|
|
50
|
+
[tool.pytest.ini_options]
|
|
51
|
+
asyncio_mode = "auto"
|
|
52
|
+
testpaths = ["tests"]
|
|
53
|
+
|
|
54
|
+
[tool.mypy]
|
|
55
|
+
python_version = "3.11"
|
|
56
|
+
strict = true
|
|
57
|
+
|
|
58
|
+
[tool.ruff]
|
|
59
|
+
line-length = 88
|
|
60
|
+
target-version = "py311"
|
pymacon-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"""Async client for the Macon Heat Pump Controller."""
|
|
2
|
+
|
|
3
|
+
from .client import (
|
|
4
|
+
ArcticControllerClient,
|
|
5
|
+
SnapshotCallback,
|
|
6
|
+
StatusCallback,
|
|
7
|
+
)
|
|
8
|
+
from .exceptions import (
|
|
9
|
+
ArcticAuthenticationError,
|
|
10
|
+
ArcticCertificateError,
|
|
11
|
+
ArcticCommandConflictError,
|
|
12
|
+
ArcticCommandValidationError,
|
|
13
|
+
ArcticConnectionError,
|
|
14
|
+
ArcticControllerError,
|
|
15
|
+
ArcticControlUnavailableError,
|
|
16
|
+
ArcticPairingError,
|
|
17
|
+
ArcticProtocolError,
|
|
18
|
+
)
|
|
19
|
+
from .models import (
|
|
20
|
+
PROTOCOL_VERSION,
|
|
21
|
+
ClientStatus,
|
|
22
|
+
CommandResult,
|
|
23
|
+
ComponentState,
|
|
24
|
+
ControllerCapabilities,
|
|
25
|
+
ControllerState,
|
|
26
|
+
ErrorState,
|
|
27
|
+
PairingResult,
|
|
28
|
+
ReadingState,
|
|
29
|
+
SetpointCapabilities,
|
|
30
|
+
SetpointRange,
|
|
31
|
+
SetpointState,
|
|
32
|
+
StateSnapshot,
|
|
33
|
+
TemperatureState,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Keep the protocol-era names available while presenting Macon names to new
|
|
37
|
+
# integrations and applications.
|
|
38
|
+
MaconClient = ArcticControllerClient
|
|
39
|
+
MaconControllerClient = ArcticControllerClient
|
|
40
|
+
MaconAuthenticationError = ArcticAuthenticationError
|
|
41
|
+
MaconCertificateError = ArcticCertificateError
|
|
42
|
+
MaconCommandConflictError = ArcticCommandConflictError
|
|
43
|
+
MaconCommandValidationError = ArcticCommandValidationError
|
|
44
|
+
MaconConnectionError = ArcticConnectionError
|
|
45
|
+
MaconControllerError = ArcticControllerError
|
|
46
|
+
MaconControlUnavailableError = ArcticControlUnavailableError
|
|
47
|
+
MaconPairingError = ArcticPairingError
|
|
48
|
+
MaconProtocolError = ArcticProtocolError
|
|
49
|
+
|
|
50
|
+
__all__ = [
|
|
51
|
+
"PROTOCOL_VERSION",
|
|
52
|
+
"ArcticAuthenticationError",
|
|
53
|
+
"ArcticCertificateError",
|
|
54
|
+
"ArcticCommandConflictError",
|
|
55
|
+
"ArcticCommandValidationError",
|
|
56
|
+
"ArcticConnectionError",
|
|
57
|
+
"ArcticControlUnavailableError",
|
|
58
|
+
"ArcticControllerClient",
|
|
59
|
+
"ArcticControllerError",
|
|
60
|
+
"ArcticPairingError",
|
|
61
|
+
"ArcticProtocolError",
|
|
62
|
+
"ClientStatus",
|
|
63
|
+
"CommandResult",
|
|
64
|
+
"ComponentState",
|
|
65
|
+
"ControllerCapabilities",
|
|
66
|
+
"ControllerState",
|
|
67
|
+
"ErrorState",
|
|
68
|
+
"MaconAuthenticationError",
|
|
69
|
+
"MaconCertificateError",
|
|
70
|
+
"MaconClient",
|
|
71
|
+
"MaconCommandConflictError",
|
|
72
|
+
"MaconCommandValidationError",
|
|
73
|
+
"MaconConnectionError",
|
|
74
|
+
"MaconControlUnavailableError",
|
|
75
|
+
"MaconControllerClient",
|
|
76
|
+
"MaconControllerError",
|
|
77
|
+
"MaconPairingError",
|
|
78
|
+
"MaconProtocolError",
|
|
79
|
+
"PairingResult",
|
|
80
|
+
"ReadingState",
|
|
81
|
+
"SetpointCapabilities",
|
|
82
|
+
"SetpointRange",
|
|
83
|
+
"SetpointState",
|
|
84
|
+
"SnapshotCallback",
|
|
85
|
+
"StateSnapshot",
|
|
86
|
+
"StatusCallback",
|
|
87
|
+
"TemperatureState",
|
|
88
|
+
]
|