python-pironman 0.1.0__tar.gz → 0.2.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.
- {python_pironman-0.1.0 → python_pironman-0.2.0}/.github/workflows/release.yml +4 -4
- {python_pironman-0.1.0 → python_pironman-0.2.0}/.github/workflows/tests.yml +2 -2
- {python_pironman-0.1.0 → python_pironman-0.2.0}/CHANGELOG.md +18 -0
- python_pironman-0.2.0/PKG-INFO +255 -0
- python_pironman-0.2.0/README.md +230 -0
- python_pironman-0.2.0/docs/hardware-validation.md +79 -0
- python_pironman-0.2.0/docs/write-api.md +34 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/pyproject.toml +1 -1
- python_pironman-0.2.0/src/pironman/client.py +265 -0
- python_pironman-0.2.0/tests/test_write_api.py +169 -0
- python_pironman-0.1.0/PKG-INFO +0 -101
- python_pironman-0.1.0/README.md +0 -76
- python_pironman-0.1.0/docs/hardware-validation.md +0 -25
- python_pironman-0.1.0/src/pironman/client.py +0 -120
- {python_pironman-0.1.0 → python_pironman-0.2.0}/.gitignore +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/CONTRIBUTING.md +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/LICENSE +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/SECURITY.md +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/docs/architecture.md +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/docs/device-identity.md +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/docs/releasing.md +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/examples/read_device.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/examples/read_metadata.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/src/pironman/__init__.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/src/pironman/const.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/src/pironman/device.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/src/pironman/exceptions.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/src/pironman/models.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/src/pironman/py.typed +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/tests/__init__.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/tests/http_mock.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/tests/test_client.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/tests/test_device.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/tests/test_distribution.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/tests/test_http_integration.py +0 -0
- {python_pironman-0.1.0 → python_pironman-0.2.0}/tests/test_package.py +0 -0
|
@@ -22,9 +22,9 @@ jobs:
|
|
|
22
22
|
runs-on: ubuntu-latest
|
|
23
23
|
|
|
24
24
|
steps:
|
|
25
|
-
- uses: actions/checkout@
|
|
25
|
+
- uses: actions/checkout@v6
|
|
26
26
|
|
|
27
|
-
- uses: actions/setup-python@
|
|
27
|
+
- uses: actions/setup-python@v6
|
|
28
28
|
with:
|
|
29
29
|
python-version: "3.13"
|
|
30
30
|
|
|
@@ -62,7 +62,7 @@ jobs:
|
|
|
62
62
|
"$PY" -c "from importlib.metadata import version; print(version('python-pironman'))"
|
|
63
63
|
|
|
64
64
|
- name: Upload distributions
|
|
65
|
-
uses: actions/upload-artifact@
|
|
65
|
+
uses: actions/upload-artifact@v6
|
|
66
66
|
with:
|
|
67
67
|
name: python-distributions
|
|
68
68
|
path: dist/
|
|
@@ -82,7 +82,7 @@ jobs:
|
|
|
82
82
|
|
|
83
83
|
steps:
|
|
84
84
|
- name: Download distributions
|
|
85
|
-
uses: actions/download-artifact@
|
|
85
|
+
uses: actions/download-artifact@v7
|
|
86
86
|
with:
|
|
87
87
|
name: python-distributions
|
|
88
88
|
path: dist/
|
|
@@ -16,9 +16,9 @@ jobs:
|
|
|
16
16
|
python-version: ["3.12", "3.13", "3.14"]
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
20
|
|
|
21
|
-
- uses: actions/setup-python@
|
|
21
|
+
- uses: actions/setup-python@v6
|
|
22
22
|
with:
|
|
23
23
|
python-version: ${{ matrix.python-version }}
|
|
24
24
|
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- Add eleven supported POST endpoints.
|
|
6
|
+
- Add typed fan, RGB and OLED controls.
|
|
7
|
+
- Validate control arguments before sending requests.
|
|
8
|
+
- Preserve existing read-only API methods.
|
|
9
|
+
- Add HTTP integration and error handling tests.
|
|
10
|
+
- Do not automatically retry hardware write operations.
|
|
11
|
+
- Exclude destructive system operations from the write API.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Unreleased
|
|
15
|
+
|
|
16
|
+
- Modernize GitHub Actions to Node.js 24.
|
|
17
|
+
- Update README for the published PyPI package.
|
|
18
|
+
- Document installation, hardware validation and public API.
|
|
19
|
+
|
|
20
|
+
|
|
3
21
|
## 0.1.0
|
|
4
22
|
|
|
5
23
|
- Initialize standalone Python package.
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: python-pironman
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Async Python client for the SunFounder Pironman REST API
|
|
5
|
+
Project-URL: Repository, https://github.com/ChristophKomenda/python-pironman
|
|
6
|
+
Project-URL: Issues, https://github.com/ChristophKomenda/python-pironman/issues
|
|
7
|
+
Author: Christoph Komenda
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Python: >=3.12
|
|
14
|
+
Requires-Dist: aiohttp<4,>=3.10
|
|
15
|
+
Requires-Dist: yarl<2,>=1.12
|
|
16
|
+
Provides-Extra: test
|
|
17
|
+
Requires-Dist: build; extra == 'test'
|
|
18
|
+
Requires-Dist: mypy; extra == 'test'
|
|
19
|
+
Requires-Dist: pytest; extra == 'test'
|
|
20
|
+
Requires-Dist: pytest-asyncio; extra == 'test'
|
|
21
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
22
|
+
Requires-Dist: ruff; extra == 'test'
|
|
23
|
+
Requires-Dist: twine; extra == 'test'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Python Pironman
|
|
27
|
+
|
|
28
|
+
[](https://pypi.org/project/python-pironman/)
|
|
29
|
+
[](https://pypi.org/project/python-pironman/)
|
|
30
|
+
[](https://github.com/ChristophKomenda/python-pironman/actions/workflows/tests.yml)
|
|
31
|
+
[](LICENSE)
|
|
32
|
+
[](https://github.com/ChristophKomenda/python-pironman/releases)
|
|
33
|
+
|
|
34
|
+
An independent asynchronous Python library for the local
|
|
35
|
+
SunFounder Pironman hardware REST API.
|
|
36
|
+
|
|
37
|
+
Designed for Home Assistant integrations, local monitoring
|
|
38
|
+
and independent Python applications.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- Asynchronous HTTP communication using aiohttp.
|
|
43
|
+
- Local REST API access without cloud dependencies.
|
|
44
|
+
- Typed device identity and capability metadata.
|
|
45
|
+
- Automatic Pironman model detection.
|
|
46
|
+
- Optional vendor-provided persistent device identity.
|
|
47
|
+
- Structured API, connection and timeout exceptions.
|
|
48
|
+
- IPv4 and IPv6 support.
|
|
49
|
+
- Externally managed HTTP sessions.
|
|
50
|
+
- Hardware monitoring and explicit device controls.
|
|
51
|
+
- No Home Assistant dependency.
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
Requires Python 3.12 or newer.
|
|
56
|
+
|
|
57
|
+
Install from PyPI, preferably in a virtual environment:
|
|
58
|
+
|
|
59
|
+
python -m pip install python-pironman
|
|
60
|
+
|
|
61
|
+
Install a specific version:
|
|
62
|
+
|
|
63
|
+
python -m pip install python-pironman==0.2.0
|
|
64
|
+
|
|
65
|
+
- [PyPI package](https://pypi.org/project/python-pironman/)
|
|
66
|
+
- [Initial release v0.1.0](https://github.com/ChristophKomenda/python-pironman/releases/tag/v0.1.0)
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
Create a Python script using the following example:
|
|
71
|
+
|
|
72
|
+
import asyncio
|
|
73
|
+
import aiohttp
|
|
74
|
+
|
|
75
|
+
from pironman import PironmanClient
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
async def main():
|
|
79
|
+
async with aiohttp.ClientSession() as session:
|
|
80
|
+
client = PironmanClient("192.0.2.10", session)
|
|
81
|
+
|
|
82
|
+
info = await client.async_get_device_metadata()
|
|
83
|
+
measurements = await client.async_get_data()
|
|
84
|
+
|
|
85
|
+
print(info.name)
|
|
86
|
+
print(info.model)
|
|
87
|
+
print(info.version)
|
|
88
|
+
print(measurements)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
asyncio.run(main())
|
|
92
|
+
|
|
93
|
+
Replace the example address with the actual Pironman host.
|
|
94
|
+
|
|
95
|
+
The default REST API port is 34001.
|
|
96
|
+
|
|
97
|
+
The caller owns the aiohttp ClientSession.
|
|
98
|
+
The library never closes externally managed sessions.
|
|
99
|
+
|
|
100
|
+
## Supported REST endpoints
|
|
101
|
+
|
|
102
|
+
| Method | Endpoint |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| GET | /api/v1.0/get-device-info |
|
|
105
|
+
| GET | /api/v1.0/get-data |
|
|
106
|
+
| GET | /api/v1.0/get-config |
|
|
107
|
+
| GET | /api/v1.0/get-ips |
|
|
108
|
+
|
|
109
|
+
The network endpoint may not be available on older
|
|
110
|
+
firmware versions.
|
|
111
|
+
|
|
112
|
+
GET methods do not modify hardware settings.
|
|
113
|
+
Explicit write methods are documented separately.
|
|
114
|
+
|
|
115
|
+
## Hardware controls
|
|
116
|
+
|
|
117
|
+
Version 0.2.0 introduces explicit asynchronous write methods
|
|
118
|
+
for fan, RGB and OLED controls.
|
|
119
|
+
|
|
120
|
+
Examples of supported methods:
|
|
121
|
+
|
|
122
|
+
await client.async_set_rgb_brightness(50)
|
|
123
|
+
await client.async_set_oled_enabled(True)
|
|
124
|
+
await client.async_set_fan_mode(3)
|
|
125
|
+
|
|
126
|
+
These examples change hardware settings.
|
|
127
|
+
|
|
128
|
+
Always verify device capabilities before performing writes.
|
|
129
|
+
|
|
130
|
+
See [Write API](docs/write-api.md).
|
|
131
|
+
|
|
132
|
+
## Device identity and capabilities
|
|
133
|
+
|
|
134
|
+
Typed device metadata is available through
|
|
135
|
+
async_get_device_metadata.
|
|
136
|
+
|
|
137
|
+
Recognized model identifiers include:
|
|
138
|
+
|
|
139
|
+
| Model | Recognition | Physical validation |
|
|
140
|
+
| --- | --- | --- |
|
|
141
|
+
| Pironman 5 | Supported | Not yet tested |
|
|
142
|
+
| Pironman 5 Mini | Supported | Not yet tested |
|
|
143
|
+
| Pironman 5 Max | Supported | Passed |
|
|
144
|
+
| Pironman 5 Pro Max | Supported | Not yet tested |
|
|
145
|
+
|
|
146
|
+
Model recognition does not establish hardware compatibility.
|
|
147
|
+
|
|
148
|
+
Capability checks distinguish supported, unsupported
|
|
149
|
+
and unknown peripherals.
|
|
150
|
+
|
|
151
|
+
Examples of vendor capability names include oled,
|
|
152
|
+
ws2812 and storage.
|
|
153
|
+
|
|
154
|
+
Persistent device UID support is optional.
|
|
155
|
+
|
|
156
|
+
Model identifiers are never used as physical device IDs.
|
|
157
|
+
No synthetic persistent hardware identifiers are generated.
|
|
158
|
+
|
|
159
|
+
See [Device identity](docs/device-identity.md).
|
|
160
|
+
|
|
161
|
+
## Hardware validation
|
|
162
|
+
|
|
163
|
+
Version 0.1.0 was validated on two separate physical
|
|
164
|
+
Pironman 5 Max devices running API version 1.3.21.
|
|
165
|
+
|
|
166
|
+
| Validation | Device A | Device B |
|
|
167
|
+
| --- | --- | --- |
|
|
168
|
+
| Connection | Local | Remote LAN |
|
|
169
|
+
| Measurement fields | 36 | 47 |
|
|
170
|
+
| Read-only REST API | Passed | Passed |
|
|
171
|
+
| Model detection | Passed | Passed |
|
|
172
|
+
| OLED capability | Supported | Supported |
|
|
173
|
+
| WS2812 capability | Supported | Supported |
|
|
174
|
+
| Storage capability | Supported | Supported |
|
|
175
|
+
|
|
176
|
+
The published PyPI package was installed in a clean
|
|
177
|
+
Python environment and tested against both devices.
|
|
178
|
+
|
|
179
|
+
See [Hardware validation](docs/hardware-validation.md).
|
|
180
|
+
|
|
181
|
+
## Quality and testing
|
|
182
|
+
|
|
183
|
+
The initial release includes:
|
|
184
|
+
|
|
185
|
+
- 85 automated tests.
|
|
186
|
+
- 100 percent statement coverage.
|
|
187
|
+
- Python 3.12, 3.13 and 3.14 CI testing.
|
|
188
|
+
- Strict mypy type checking.
|
|
189
|
+
- Ruff linting and formatting.
|
|
190
|
+
- Real local HTTP integration tests.
|
|
191
|
+
- Wheel and source distribution validation.
|
|
192
|
+
- Clean package installation testing.
|
|
193
|
+
- Automated PyPI Trusted Publishing.
|
|
194
|
+
|
|
195
|
+
Statement coverage does not guarantee complete
|
|
196
|
+
branch coverage or absence of defects.
|
|
197
|
+
|
|
198
|
+
## Development
|
|
199
|
+
|
|
200
|
+
Clone the repository:
|
|
201
|
+
|
|
202
|
+
git clone https://github.com/ChristophKomenda/python-pironman.git
|
|
203
|
+
cd python-pironman
|
|
204
|
+
|
|
205
|
+
Create a development environment:
|
|
206
|
+
|
|
207
|
+
python -m venv .venv
|
|
208
|
+
source .venv/bin/activate
|
|
209
|
+
python -m pip install -e ".[test]"
|
|
210
|
+
|
|
211
|
+
Run the test suite:
|
|
212
|
+
|
|
213
|
+
pytest --cov=pironman --cov-report=term-missing
|
|
214
|
+
|
|
215
|
+
Read hardware data:
|
|
216
|
+
|
|
217
|
+
python examples/read_device.py 192.0.2.10
|
|
218
|
+
|
|
219
|
+
Read typed hardware metadata:
|
|
220
|
+
|
|
221
|
+
python examples/read_metadata.py 192.0.2.10
|
|
222
|
+
|
|
223
|
+
## Documentation
|
|
224
|
+
|
|
225
|
+
- [Architecture](docs/architecture.md)
|
|
226
|
+
- [Device identity](docs/device-identity.md)
|
|
227
|
+
- [Hardware validation](docs/hardware-validation.md)
|
|
228
|
+
- [Release process](docs/releasing.md)
|
|
229
|
+
- [Contributing](CONTRIBUTING.md)
|
|
230
|
+
- [Security policy](SECURITY.md)
|
|
231
|
+
|
|
232
|
+
## Ecosystem
|
|
233
|
+
|
|
234
|
+
- [Pironman Home Assistant HACS integration](https://github.com/ChristophKomenda/pironman5-homeassistant-container)
|
|
235
|
+
- [SunFounder Pironman software](https://github.com/sunfounder/pironman5)
|
|
236
|
+
- [Upstream device identity proposal](https://github.com/sunfounder/pironman5/pull/130)
|
|
237
|
+
|
|
238
|
+
The long-term goal is to support an official Home Assistant
|
|
239
|
+
Core integration through this standalone library.
|
|
240
|
+
|
|
241
|
+
This is an independently maintained project.
|
|
242
|
+
It is not an official SunFounder or Home Assistant product.
|
|
243
|
+
|
|
244
|
+
## License
|
|
245
|
+
|
|
246
|
+
MIT
|
|
247
|
+
|
|
248
|
+
### Version 0.2.0 validation
|
|
249
|
+
|
|
250
|
+
- All 15 implemented REST endpoints exercised on two
|
|
251
|
+
physical Pironman 5 Max devices.
|
|
252
|
+
- 126 passing automated tests.
|
|
253
|
+
- 100 percent statement coverage.
|
|
254
|
+
- 20 changed settings successfully restored.
|
|
255
|
+
- Fan mode validated using same-value writes.
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Python Pironman
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/python-pironman/)
|
|
4
|
+
[](https://pypi.org/project/python-pironman/)
|
|
5
|
+
[](https://github.com/ChristophKomenda/python-pironman/actions/workflows/tests.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/ChristophKomenda/python-pironman/releases)
|
|
8
|
+
|
|
9
|
+
An independent asynchronous Python library for the local
|
|
10
|
+
SunFounder Pironman hardware REST API.
|
|
11
|
+
|
|
12
|
+
Designed for Home Assistant integrations, local monitoring
|
|
13
|
+
and independent Python applications.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- Asynchronous HTTP communication using aiohttp.
|
|
18
|
+
- Local REST API access without cloud dependencies.
|
|
19
|
+
- Typed device identity and capability metadata.
|
|
20
|
+
- Automatic Pironman model detection.
|
|
21
|
+
- Optional vendor-provided persistent device identity.
|
|
22
|
+
- Structured API, connection and timeout exceptions.
|
|
23
|
+
- IPv4 and IPv6 support.
|
|
24
|
+
- Externally managed HTTP sessions.
|
|
25
|
+
- Hardware monitoring and explicit device controls.
|
|
26
|
+
- No Home Assistant dependency.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
Requires Python 3.12 or newer.
|
|
31
|
+
|
|
32
|
+
Install from PyPI, preferably in a virtual environment:
|
|
33
|
+
|
|
34
|
+
python -m pip install python-pironman
|
|
35
|
+
|
|
36
|
+
Install a specific version:
|
|
37
|
+
|
|
38
|
+
python -m pip install python-pironman==0.2.0
|
|
39
|
+
|
|
40
|
+
- [PyPI package](https://pypi.org/project/python-pironman/)
|
|
41
|
+
- [Initial release v0.1.0](https://github.com/ChristophKomenda/python-pironman/releases/tag/v0.1.0)
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
Create a Python script using the following example:
|
|
46
|
+
|
|
47
|
+
import asyncio
|
|
48
|
+
import aiohttp
|
|
49
|
+
|
|
50
|
+
from pironman import PironmanClient
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
async def main():
|
|
54
|
+
async with aiohttp.ClientSession() as session:
|
|
55
|
+
client = PironmanClient("192.0.2.10", session)
|
|
56
|
+
|
|
57
|
+
info = await client.async_get_device_metadata()
|
|
58
|
+
measurements = await client.async_get_data()
|
|
59
|
+
|
|
60
|
+
print(info.name)
|
|
61
|
+
print(info.model)
|
|
62
|
+
print(info.version)
|
|
63
|
+
print(measurements)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
asyncio.run(main())
|
|
67
|
+
|
|
68
|
+
Replace the example address with the actual Pironman host.
|
|
69
|
+
|
|
70
|
+
The default REST API port is 34001.
|
|
71
|
+
|
|
72
|
+
The caller owns the aiohttp ClientSession.
|
|
73
|
+
The library never closes externally managed sessions.
|
|
74
|
+
|
|
75
|
+
## Supported REST endpoints
|
|
76
|
+
|
|
77
|
+
| Method | Endpoint |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| GET | /api/v1.0/get-device-info |
|
|
80
|
+
| GET | /api/v1.0/get-data |
|
|
81
|
+
| GET | /api/v1.0/get-config |
|
|
82
|
+
| GET | /api/v1.0/get-ips |
|
|
83
|
+
|
|
84
|
+
The network endpoint may not be available on older
|
|
85
|
+
firmware versions.
|
|
86
|
+
|
|
87
|
+
GET methods do not modify hardware settings.
|
|
88
|
+
Explicit write methods are documented separately.
|
|
89
|
+
|
|
90
|
+
## Hardware controls
|
|
91
|
+
|
|
92
|
+
Version 0.2.0 introduces explicit asynchronous write methods
|
|
93
|
+
for fan, RGB and OLED controls.
|
|
94
|
+
|
|
95
|
+
Examples of supported methods:
|
|
96
|
+
|
|
97
|
+
await client.async_set_rgb_brightness(50)
|
|
98
|
+
await client.async_set_oled_enabled(True)
|
|
99
|
+
await client.async_set_fan_mode(3)
|
|
100
|
+
|
|
101
|
+
These examples change hardware settings.
|
|
102
|
+
|
|
103
|
+
Always verify device capabilities before performing writes.
|
|
104
|
+
|
|
105
|
+
See [Write API](docs/write-api.md).
|
|
106
|
+
|
|
107
|
+
## Device identity and capabilities
|
|
108
|
+
|
|
109
|
+
Typed device metadata is available through
|
|
110
|
+
async_get_device_metadata.
|
|
111
|
+
|
|
112
|
+
Recognized model identifiers include:
|
|
113
|
+
|
|
114
|
+
| Model | Recognition | Physical validation |
|
|
115
|
+
| --- | --- | --- |
|
|
116
|
+
| Pironman 5 | Supported | Not yet tested |
|
|
117
|
+
| Pironman 5 Mini | Supported | Not yet tested |
|
|
118
|
+
| Pironman 5 Max | Supported | Passed |
|
|
119
|
+
| Pironman 5 Pro Max | Supported | Not yet tested |
|
|
120
|
+
|
|
121
|
+
Model recognition does not establish hardware compatibility.
|
|
122
|
+
|
|
123
|
+
Capability checks distinguish supported, unsupported
|
|
124
|
+
and unknown peripherals.
|
|
125
|
+
|
|
126
|
+
Examples of vendor capability names include oled,
|
|
127
|
+
ws2812 and storage.
|
|
128
|
+
|
|
129
|
+
Persistent device UID support is optional.
|
|
130
|
+
|
|
131
|
+
Model identifiers are never used as physical device IDs.
|
|
132
|
+
No synthetic persistent hardware identifiers are generated.
|
|
133
|
+
|
|
134
|
+
See [Device identity](docs/device-identity.md).
|
|
135
|
+
|
|
136
|
+
## Hardware validation
|
|
137
|
+
|
|
138
|
+
Version 0.1.0 was validated on two separate physical
|
|
139
|
+
Pironman 5 Max devices running API version 1.3.21.
|
|
140
|
+
|
|
141
|
+
| Validation | Device A | Device B |
|
|
142
|
+
| --- | --- | --- |
|
|
143
|
+
| Connection | Local | Remote LAN |
|
|
144
|
+
| Measurement fields | 36 | 47 |
|
|
145
|
+
| Read-only REST API | Passed | Passed |
|
|
146
|
+
| Model detection | Passed | Passed |
|
|
147
|
+
| OLED capability | Supported | Supported |
|
|
148
|
+
| WS2812 capability | Supported | Supported |
|
|
149
|
+
| Storage capability | Supported | Supported |
|
|
150
|
+
|
|
151
|
+
The published PyPI package was installed in a clean
|
|
152
|
+
Python environment and tested against both devices.
|
|
153
|
+
|
|
154
|
+
See [Hardware validation](docs/hardware-validation.md).
|
|
155
|
+
|
|
156
|
+
## Quality and testing
|
|
157
|
+
|
|
158
|
+
The initial release includes:
|
|
159
|
+
|
|
160
|
+
- 85 automated tests.
|
|
161
|
+
- 100 percent statement coverage.
|
|
162
|
+
- Python 3.12, 3.13 and 3.14 CI testing.
|
|
163
|
+
- Strict mypy type checking.
|
|
164
|
+
- Ruff linting and formatting.
|
|
165
|
+
- Real local HTTP integration tests.
|
|
166
|
+
- Wheel and source distribution validation.
|
|
167
|
+
- Clean package installation testing.
|
|
168
|
+
- Automated PyPI Trusted Publishing.
|
|
169
|
+
|
|
170
|
+
Statement coverage does not guarantee complete
|
|
171
|
+
branch coverage or absence of defects.
|
|
172
|
+
|
|
173
|
+
## Development
|
|
174
|
+
|
|
175
|
+
Clone the repository:
|
|
176
|
+
|
|
177
|
+
git clone https://github.com/ChristophKomenda/python-pironman.git
|
|
178
|
+
cd python-pironman
|
|
179
|
+
|
|
180
|
+
Create a development environment:
|
|
181
|
+
|
|
182
|
+
python -m venv .venv
|
|
183
|
+
source .venv/bin/activate
|
|
184
|
+
python -m pip install -e ".[test]"
|
|
185
|
+
|
|
186
|
+
Run the test suite:
|
|
187
|
+
|
|
188
|
+
pytest --cov=pironman --cov-report=term-missing
|
|
189
|
+
|
|
190
|
+
Read hardware data:
|
|
191
|
+
|
|
192
|
+
python examples/read_device.py 192.0.2.10
|
|
193
|
+
|
|
194
|
+
Read typed hardware metadata:
|
|
195
|
+
|
|
196
|
+
python examples/read_metadata.py 192.0.2.10
|
|
197
|
+
|
|
198
|
+
## Documentation
|
|
199
|
+
|
|
200
|
+
- [Architecture](docs/architecture.md)
|
|
201
|
+
- [Device identity](docs/device-identity.md)
|
|
202
|
+
- [Hardware validation](docs/hardware-validation.md)
|
|
203
|
+
- [Release process](docs/releasing.md)
|
|
204
|
+
- [Contributing](CONTRIBUTING.md)
|
|
205
|
+
- [Security policy](SECURITY.md)
|
|
206
|
+
|
|
207
|
+
## Ecosystem
|
|
208
|
+
|
|
209
|
+
- [Pironman Home Assistant HACS integration](https://github.com/ChristophKomenda/pironman5-homeassistant-container)
|
|
210
|
+
- [SunFounder Pironman software](https://github.com/sunfounder/pironman5)
|
|
211
|
+
- [Upstream device identity proposal](https://github.com/sunfounder/pironman5/pull/130)
|
|
212
|
+
|
|
213
|
+
The long-term goal is to support an official Home Assistant
|
|
214
|
+
Core integration through this standalone library.
|
|
215
|
+
|
|
216
|
+
This is an independently maintained project.
|
|
217
|
+
It is not an official SunFounder or Home Assistant product.
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
MIT
|
|
222
|
+
|
|
223
|
+
### Version 0.2.0 validation
|
|
224
|
+
|
|
225
|
+
- All 15 implemented REST endpoints exercised on two
|
|
226
|
+
physical Pironman 5 Max devices.
|
|
227
|
+
- 126 passing automated tests.
|
|
228
|
+
- 100 percent statement coverage.
|
|
229
|
+
- 20 changed settings successfully restored.
|
|
230
|
+
- Fan mode validated using same-value writes.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Hardware validation
|
|
2
|
+
|
|
3
|
+
Date: 2026-11-29
|
|
4
|
+
|
|
5
|
+
Two separate physical Pironman 5 Max devices were tested
|
|
6
|
+
using the standalone asynchronous Python client.
|
|
7
|
+
|
|
8
|
+
| Property | Device A | Device B |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| API version | 1.3.21 | 1.3.21 |
|
|
11
|
+
| Connection | Local | Remote LAN |
|
|
12
|
+
| Device metadata fields | 6 | 6 |
|
|
13
|
+
| Measurement fields | 36 | 47 |
|
|
14
|
+
| Configuration fields | 1 | 1 |
|
|
15
|
+
| Network endpoint | PASS | PASS |
|
|
16
|
+
| Persistent UID available | No | No |
|
|
17
|
+
| Read-only validation | PASS | PASS |
|
|
18
|
+
|
|
19
|
+
All four supported GET endpoints worked on both devices.
|
|
20
|
+
|
|
21
|
+
No hardware configuration was changed.
|
|
22
|
+
|
|
23
|
+
Persistent device identity remains pending upstream review.
|
|
24
|
+
|
|
25
|
+
Related: https://github.com/sunfounder/pironman5/pull/130
|
|
26
|
+
|
|
27
|
+
## Version 0.2.0 - Read and write API validation
|
|
28
|
+
|
|
29
|
+
Validation date: 2026-11-29.
|
|
30
|
+
|
|
31
|
+
Environment:
|
|
32
|
+
|
|
33
|
+
- Two separate physical Pironman 5 Max devices.
|
|
34
|
+
- Vendor API version 1.3.21 on both devices.
|
|
35
|
+
- Local and remote LAN communication.
|
|
36
|
+
- Python 3.13.
|
|
37
|
+
- python-pironman 0.2.0 development version.
|
|
38
|
+
|
|
39
|
+
### Endpoint validation
|
|
40
|
+
|
|
41
|
+
| Endpoint | Device A | Device B |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| get-device-info | PASS | PASS |
|
|
44
|
+
| get-data | PASS | PASS |
|
|
45
|
+
| get-config | PASS | PASS |
|
|
46
|
+
| get-ips | PASS | PASS |
|
|
47
|
+
| set-rgb-enable | PASS | PASS |
|
|
48
|
+
| set-rgb-color | PASS | PASS |
|
|
49
|
+
| set-rgb-brightness | PASS | PASS |
|
|
50
|
+
| set-rgb-style | PASS | PASS |
|
|
51
|
+
| set-rgb-speed | PASS | PASS |
|
|
52
|
+
| set-oled-enable | PASS | PASS |
|
|
53
|
+
| set-oled-rotation | PASS | PASS |
|
|
54
|
+
| set-oled-pages | PASS | PASS |
|
|
55
|
+
| set-oled-sleep-timeout | PASS | PASS |
|
|
56
|
+
| set-fan-led | PASS | PASS |
|
|
57
|
+
| set-fan-mode | PASS (same value) | PASS (same value) |
|
|
58
|
+
|
|
59
|
+
### Results
|
|
60
|
+
|
|
61
|
+
- 30 successful physical endpoint checks.
|
|
62
|
+
- 20 changed settings successfully restored.
|
|
63
|
+
- Two successful same-value fan mode writes.
|
|
64
|
+
- All changed values verified through configuration readback.
|
|
65
|
+
- Existing read API remains operational.
|
|
66
|
+
- 126 automated tests passed.
|
|
67
|
+
- 100% statement coverage.
|
|
68
|
+
|
|
69
|
+
### Limitations
|
|
70
|
+
|
|
71
|
+
Fan mode was deliberately written using the existing value.
|
|
72
|
+
Cooling behavior was not intentionally changed.
|
|
73
|
+
|
|
74
|
+
Other Pironman hardware variants remain physically unverified.
|
|
75
|
+
|
|
76
|
+
These results demonstrate API communication and configuration
|
|
77
|
+
readback, not exhaustive validation of every possible setting.
|
|
78
|
+
|
|
79
|
+
No reboot, shutdown or destructive system operations were tested.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Write API
|
|
2
|
+
|
|
3
|
+
Version 0.2.0 introduces explicit hardware control methods.
|
|
4
|
+
|
|
5
|
+
Supported controls:
|
|
6
|
+
|
|
7
|
+
- GPIO fan mode and LED mode.
|
|
8
|
+
- RGB enable, color, brightness, style and speed.
|
|
9
|
+
- OLED enable, rotation, pages and sleep timeout.
|
|
10
|
+
|
|
11
|
+
Typed methods validate their arguments.
|
|
12
|
+
|
|
13
|
+
The lower-level async_post method restricts endpoint names
|
|
14
|
+
but leaves payload validation to the caller.
|
|
15
|
+
|
|
16
|
+
Applications must check hardware capabilities before
|
|
17
|
+
performing writes.
|
|
18
|
+
|
|
19
|
+
Writes are never performed automatically during setup
|
|
20
|
+
or discovery.
|
|
21
|
+
|
|
22
|
+
No automatic retry is performed after a write failure.
|
|
23
|
+
A timeout does not guarantee that the hardware operation
|
|
24
|
+
was unsuccessful.
|
|
25
|
+
|
|
26
|
+
Shutdown, reboot, log deletion and other system operations
|
|
27
|
+
are not supported in this release.
|
|
28
|
+
|
|
29
|
+
The existing read API remains backward compatible.
|
|
30
|
+
|
|
31
|
+
Physical write validation was completed on two Pironman 5 Max devices.
|
|
32
|
+
Automated HTTP tests use a local test server.
|
|
33
|
+
|
|
34
|
+
See [Hardware validation](hardware-validation.md).
|