matter-python-client 0.4.1__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.
- matter_python_client-0.4.1/PKG-INFO +106 -0
- matter_python_client-0.4.1/README.md +80 -0
- matter_python_client-0.4.1/matter_python_client.egg-info/PKG-INFO +106 -0
- matter_python_client-0.4.1/matter_python_client.egg-info/SOURCES.txt +29 -0
- matter_python_client-0.4.1/matter_python_client.egg-info/dependency_links.txt +1 -0
- matter_python_client-0.4.1/matter_python_client.egg-info/not-zip-safe +1 -0
- matter_python_client-0.4.1/matter_python_client.egg-info/requires.txt +8 -0
- matter_python_client-0.4.1/matter_python_client.egg-info/top_level.txt +1 -0
- matter_python_client-0.4.1/matter_server/__init__.py +1 -0
- matter_python_client-0.4.1/matter_server/client/__init__.py +5 -0
- matter_python_client-0.4.1/matter_server/client/client.py +806 -0
- matter_python_client-0.4.1/matter_server/client/connection.py +177 -0
- matter_python_client-0.4.1/matter_server/client/exceptions.py +63 -0
- matter_python_client-0.4.1/matter_server/client/models/__init__.py +1 -0
- matter_python_client-0.4.1/matter_server/client/models/device_types.py +952 -0
- matter_python_client-0.4.1/matter_server/client/models/node.py +414 -0
- matter_python_client-0.4.1/matter_server/common/__init__.py +1 -0
- matter_python_client-0.4.1/matter_server/common/const.py +8 -0
- matter_python_client-0.4.1/matter_server/common/custom_clusters.py +1371 -0
- matter_python_client-0.4.1/matter_server/common/errors.py +94 -0
- matter_python_client-0.4.1/matter_server/common/helpers/__init__.py +0 -0
- matter_python_client-0.4.1/matter_server/common/helpers/api.py +70 -0
- matter_python_client-0.4.1/matter_server/common/helpers/json.py +48 -0
- matter_python_client-0.4.1/matter_server/common/helpers/util.py +359 -0
- matter_python_client-0.4.1/matter_server/common/models.py +273 -0
- matter_python_client-0.4.1/matter_server/py.typed +0 -0
- matter_python_client-0.4.1/pyproject.toml +61 -0
- matter_python_client-0.4.1/setup.cfg +4 -0
- matter_python_client-0.4.1/tests/test_client_integration.py +98 -0
- matter_python_client-0.4.1/tests/test_imports.py +125 -0
- matter_python_client-0.4.1/tests/test_integration.py +1140 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: matter-python-client
|
|
3
|
+
Version: 0.4.1
|
|
4
|
+
Summary: Python Client for the OHF Matter Server
|
|
5
|
+
Author-email: Open Home Foundation <hello@openhomefoundation.io>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/matter-js/matterjs-server
|
|
8
|
+
Project-URL: Source, https://github.com/matter-js/matterjs-server/tree/main/python_client
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/matter-js/matterjs-server/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/matter-js/matterjs-server/blob/main/CHANGELOG.md
|
|
11
|
+
Platform: any
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Home Automation
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Requires-Dist: aiohttp
|
|
20
|
+
Requires-Dist: orjson
|
|
21
|
+
Requires-Dist: home-assistant-chip-clusters==2025.7.0
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: pytest>=9.0; extra == "test"
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "test"
|
|
25
|
+
Requires-Dist: pytest-aiohttp>=1.0; extra == "test"
|
|
26
|
+
|
|
27
|
+
# Python Client for the OHF Matter Server
|
|
28
|
+
|
|
29
|
+
A PyPI package (`matter-python-client`) providing Python bindings for the [OHF Matter Server](https://github.com/matter-js/matterjs-server). This is a drop-in replacement for the client portion of [`python-matter-server`](https://github.com/matter-js/python-matter-server), with custom cluster definitions updated to match the Matter.js server.
|
|
30
|
+
|
|
31
|
+
## Origin
|
|
32
|
+
|
|
33
|
+
The client and common modules were copied from [`python-matter-server` v8.1.2](https://github.com/matter-js/python-matter-server) and modified:
|
|
34
|
+
|
|
35
|
+
- **Source**: `matter_server/client/` and `matter_server/common/` from python-matter-server
|
|
36
|
+
- **Modified**: `matter_server/common/custom_clusters.py` — updated to match the JS server's cluster definitions
|
|
37
|
+
- **Excluded**: `matter_server/server/` (the JS server replaces it), `common/helpers/logger.py` (depends on `coloredlogs`, a server-only dependency)
|
|
38
|
+
|
|
39
|
+
### Custom Cluster Changes
|
|
40
|
+
|
|
41
|
+
| Cluster | Change |
|
|
42
|
+
|---------|--------|
|
|
43
|
+
| EveCluster | +8 attributes (getConfig, setConfig, loggingMetadata, loggingData, lastEventTime, statusFault, childLock, rloc16), wattAccumulatedControlPoint type fixed |
|
|
44
|
+
| HeimanCluster | Attribute IDs shortened to match JS server |
|
|
45
|
+
| NeoCluster | Types changed from float32 to uint |
|
|
46
|
+
| Polling | Removed (JS server handles polling natively) |
|
|
47
|
+
|
|
48
|
+
## Package
|
|
49
|
+
|
|
50
|
+
- **PyPI name**: `matter-python-client`
|
|
51
|
+
- **Python module**: `matter_server` (same import path as `python-matter-server`)
|
|
52
|
+
- **Python**: >= 3.12
|
|
53
|
+
- **Dependencies**: `aiohttp`, `orjson`, `home-assistant-chip-clusters`
|
|
54
|
+
|
|
55
|
+
## npm Scripts (from monorepo root)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# First-time setup: create venv and install with test dependencies
|
|
59
|
+
npm run python:install
|
|
60
|
+
|
|
61
|
+
# Run unit + mock server tests (fast, ~1s)
|
|
62
|
+
npm run python:test
|
|
63
|
+
|
|
64
|
+
# Run full integration tests against real Matter.js server + test device (~40s)
|
|
65
|
+
npm run python:test-integration
|
|
66
|
+
|
|
67
|
+
# Run all Python tests
|
|
68
|
+
npm run python:test-all
|
|
69
|
+
|
|
70
|
+
# Build the PyPI package (.tar.gz + .whl)
|
|
71
|
+
npm run python:build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
The package provides the same `matter_server.client` API as `python-matter-server`:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import aiohttp
|
|
80
|
+
from matter_server.client import MatterClient
|
|
81
|
+
|
|
82
|
+
async with aiohttp.ClientSession() as session:
|
|
83
|
+
client = MatterClient("ws://localhost:5580/ws", session)
|
|
84
|
+
await client.connect()
|
|
85
|
+
|
|
86
|
+
init_ready = asyncio.Event()
|
|
87
|
+
listen_task = asyncio.create_task(client.start_listening(init_ready))
|
|
88
|
+
await init_ready.wait()
|
|
89
|
+
|
|
90
|
+
nodes = client.get_nodes()
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
To use this package instead of `python-matter-server` in the Home Assistant Matter integration, change `manifest.json`:
|
|
94
|
+
|
|
95
|
+
```diff
|
|
96
|
+
- "requirements": ["python-matter-server==8.1.2"],
|
|
97
|
+
+ "requirements": ["matter-python-client==1.0.0"],
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Testing
|
|
101
|
+
|
|
102
|
+
The test suite has three layers:
|
|
103
|
+
|
|
104
|
+
- **Import smoke tests** (8 tests) — verify all HA integration imports resolve
|
|
105
|
+
- **Mock server tests** (4 tests) — Python client against JS MockMatterServer subprocess
|
|
106
|
+
- **Integration tests** (63 tests) — Python client against real Matter.js server + test device, mirroring the JS `IntegrationTest.ts`
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Python Client for the OHF Matter Server
|
|
2
|
+
|
|
3
|
+
A PyPI package (`matter-python-client`) providing Python bindings for the [OHF Matter Server](https://github.com/matter-js/matterjs-server). This is a drop-in replacement for the client portion of [`python-matter-server`](https://github.com/matter-js/python-matter-server), with custom cluster definitions updated to match the Matter.js server.
|
|
4
|
+
|
|
5
|
+
## Origin
|
|
6
|
+
|
|
7
|
+
The client and common modules were copied from [`python-matter-server` v8.1.2](https://github.com/matter-js/python-matter-server) and modified:
|
|
8
|
+
|
|
9
|
+
- **Source**: `matter_server/client/` and `matter_server/common/` from python-matter-server
|
|
10
|
+
- **Modified**: `matter_server/common/custom_clusters.py` — updated to match the JS server's cluster definitions
|
|
11
|
+
- **Excluded**: `matter_server/server/` (the JS server replaces it), `common/helpers/logger.py` (depends on `coloredlogs`, a server-only dependency)
|
|
12
|
+
|
|
13
|
+
### Custom Cluster Changes
|
|
14
|
+
|
|
15
|
+
| Cluster | Change |
|
|
16
|
+
|---------|--------|
|
|
17
|
+
| EveCluster | +8 attributes (getConfig, setConfig, loggingMetadata, loggingData, lastEventTime, statusFault, childLock, rloc16), wattAccumulatedControlPoint type fixed |
|
|
18
|
+
| HeimanCluster | Attribute IDs shortened to match JS server |
|
|
19
|
+
| NeoCluster | Types changed from float32 to uint |
|
|
20
|
+
| Polling | Removed (JS server handles polling natively) |
|
|
21
|
+
|
|
22
|
+
## Package
|
|
23
|
+
|
|
24
|
+
- **PyPI name**: `matter-python-client`
|
|
25
|
+
- **Python module**: `matter_server` (same import path as `python-matter-server`)
|
|
26
|
+
- **Python**: >= 3.12
|
|
27
|
+
- **Dependencies**: `aiohttp`, `orjson`, `home-assistant-chip-clusters`
|
|
28
|
+
|
|
29
|
+
## npm Scripts (from monorepo root)
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# First-time setup: create venv and install with test dependencies
|
|
33
|
+
npm run python:install
|
|
34
|
+
|
|
35
|
+
# Run unit + mock server tests (fast, ~1s)
|
|
36
|
+
npm run python:test
|
|
37
|
+
|
|
38
|
+
# Run full integration tests against real Matter.js server + test device (~40s)
|
|
39
|
+
npm run python:test-integration
|
|
40
|
+
|
|
41
|
+
# Run all Python tests
|
|
42
|
+
npm run python:test-all
|
|
43
|
+
|
|
44
|
+
# Build the PyPI package (.tar.gz + .whl)
|
|
45
|
+
npm run python:build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
The package provides the same `matter_server.client` API as `python-matter-server`:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import aiohttp
|
|
54
|
+
from matter_server.client import MatterClient
|
|
55
|
+
|
|
56
|
+
async with aiohttp.ClientSession() as session:
|
|
57
|
+
client = MatterClient("ws://localhost:5580/ws", session)
|
|
58
|
+
await client.connect()
|
|
59
|
+
|
|
60
|
+
init_ready = asyncio.Event()
|
|
61
|
+
listen_task = asyncio.create_task(client.start_listening(init_ready))
|
|
62
|
+
await init_ready.wait()
|
|
63
|
+
|
|
64
|
+
nodes = client.get_nodes()
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
To use this package instead of `python-matter-server` in the Home Assistant Matter integration, change `manifest.json`:
|
|
68
|
+
|
|
69
|
+
```diff
|
|
70
|
+
- "requirements": ["python-matter-server==8.1.2"],
|
|
71
|
+
+ "requirements": ["matter-python-client==1.0.0"],
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Testing
|
|
75
|
+
|
|
76
|
+
The test suite has three layers:
|
|
77
|
+
|
|
78
|
+
- **Import smoke tests** (8 tests) — verify all HA integration imports resolve
|
|
79
|
+
- **Mock server tests** (4 tests) — Python client against JS MockMatterServer subprocess
|
|
80
|
+
- **Integration tests** (63 tests) — Python client against real Matter.js server + test device, mirroring the JS `IntegrationTest.ts`
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: matter-python-client
|
|
3
|
+
Version: 0.4.1
|
|
4
|
+
Summary: Python Client for the OHF Matter Server
|
|
5
|
+
Author-email: Open Home Foundation <hello@openhomefoundation.io>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/matter-js/matterjs-server
|
|
8
|
+
Project-URL: Source, https://github.com/matter-js/matterjs-server/tree/main/python_client
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/matter-js/matterjs-server/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/matter-js/matterjs-server/blob/main/CHANGELOG.md
|
|
11
|
+
Platform: any
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Topic :: Home Automation
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Requires-Dist: aiohttp
|
|
20
|
+
Requires-Dist: orjson
|
|
21
|
+
Requires-Dist: home-assistant-chip-clusters==2025.7.0
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: pytest>=9.0; extra == "test"
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == "test"
|
|
25
|
+
Requires-Dist: pytest-aiohttp>=1.0; extra == "test"
|
|
26
|
+
|
|
27
|
+
# Python Client for the OHF Matter Server
|
|
28
|
+
|
|
29
|
+
A PyPI package (`matter-python-client`) providing Python bindings for the [OHF Matter Server](https://github.com/matter-js/matterjs-server). This is a drop-in replacement for the client portion of [`python-matter-server`](https://github.com/matter-js/python-matter-server), with custom cluster definitions updated to match the Matter.js server.
|
|
30
|
+
|
|
31
|
+
## Origin
|
|
32
|
+
|
|
33
|
+
The client and common modules were copied from [`python-matter-server` v8.1.2](https://github.com/matter-js/python-matter-server) and modified:
|
|
34
|
+
|
|
35
|
+
- **Source**: `matter_server/client/` and `matter_server/common/` from python-matter-server
|
|
36
|
+
- **Modified**: `matter_server/common/custom_clusters.py` — updated to match the JS server's cluster definitions
|
|
37
|
+
- **Excluded**: `matter_server/server/` (the JS server replaces it), `common/helpers/logger.py` (depends on `coloredlogs`, a server-only dependency)
|
|
38
|
+
|
|
39
|
+
### Custom Cluster Changes
|
|
40
|
+
|
|
41
|
+
| Cluster | Change |
|
|
42
|
+
|---------|--------|
|
|
43
|
+
| EveCluster | +8 attributes (getConfig, setConfig, loggingMetadata, loggingData, lastEventTime, statusFault, childLock, rloc16), wattAccumulatedControlPoint type fixed |
|
|
44
|
+
| HeimanCluster | Attribute IDs shortened to match JS server |
|
|
45
|
+
| NeoCluster | Types changed from float32 to uint |
|
|
46
|
+
| Polling | Removed (JS server handles polling natively) |
|
|
47
|
+
|
|
48
|
+
## Package
|
|
49
|
+
|
|
50
|
+
- **PyPI name**: `matter-python-client`
|
|
51
|
+
- **Python module**: `matter_server` (same import path as `python-matter-server`)
|
|
52
|
+
- **Python**: >= 3.12
|
|
53
|
+
- **Dependencies**: `aiohttp`, `orjson`, `home-assistant-chip-clusters`
|
|
54
|
+
|
|
55
|
+
## npm Scripts (from monorepo root)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# First-time setup: create venv and install with test dependencies
|
|
59
|
+
npm run python:install
|
|
60
|
+
|
|
61
|
+
# Run unit + mock server tests (fast, ~1s)
|
|
62
|
+
npm run python:test
|
|
63
|
+
|
|
64
|
+
# Run full integration tests against real Matter.js server + test device (~40s)
|
|
65
|
+
npm run python:test-integration
|
|
66
|
+
|
|
67
|
+
# Run all Python tests
|
|
68
|
+
npm run python:test-all
|
|
69
|
+
|
|
70
|
+
# Build the PyPI package (.tar.gz + .whl)
|
|
71
|
+
npm run python:build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
The package provides the same `matter_server.client` API as `python-matter-server`:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import aiohttp
|
|
80
|
+
from matter_server.client import MatterClient
|
|
81
|
+
|
|
82
|
+
async with aiohttp.ClientSession() as session:
|
|
83
|
+
client = MatterClient("ws://localhost:5580/ws", session)
|
|
84
|
+
await client.connect()
|
|
85
|
+
|
|
86
|
+
init_ready = asyncio.Event()
|
|
87
|
+
listen_task = asyncio.create_task(client.start_listening(init_ready))
|
|
88
|
+
await init_ready.wait()
|
|
89
|
+
|
|
90
|
+
nodes = client.get_nodes()
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
To use this package instead of `python-matter-server` in the Home Assistant Matter integration, change `manifest.json`:
|
|
94
|
+
|
|
95
|
+
```diff
|
|
96
|
+
- "requirements": ["python-matter-server==8.1.2"],
|
|
97
|
+
+ "requirements": ["matter-python-client==1.0.0"],
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Testing
|
|
101
|
+
|
|
102
|
+
The test suite has three layers:
|
|
103
|
+
|
|
104
|
+
- **Import smoke tests** (8 tests) — verify all HA integration imports resolve
|
|
105
|
+
- **Mock server tests** (4 tests) — Python client against JS MockMatterServer subprocess
|
|
106
|
+
- **Integration tests** (63 tests) — Python client against real Matter.js server + test device, mirroring the JS `IntegrationTest.ts`
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
matter_python_client.egg-info/PKG-INFO
|
|
4
|
+
matter_python_client.egg-info/SOURCES.txt
|
|
5
|
+
matter_python_client.egg-info/dependency_links.txt
|
|
6
|
+
matter_python_client.egg-info/not-zip-safe
|
|
7
|
+
matter_python_client.egg-info/requires.txt
|
|
8
|
+
matter_python_client.egg-info/top_level.txt
|
|
9
|
+
matter_server/__init__.py
|
|
10
|
+
matter_server/py.typed
|
|
11
|
+
matter_server/client/__init__.py
|
|
12
|
+
matter_server/client/client.py
|
|
13
|
+
matter_server/client/connection.py
|
|
14
|
+
matter_server/client/exceptions.py
|
|
15
|
+
matter_server/client/models/__init__.py
|
|
16
|
+
matter_server/client/models/device_types.py
|
|
17
|
+
matter_server/client/models/node.py
|
|
18
|
+
matter_server/common/__init__.py
|
|
19
|
+
matter_server/common/const.py
|
|
20
|
+
matter_server/common/custom_clusters.py
|
|
21
|
+
matter_server/common/errors.py
|
|
22
|
+
matter_server/common/models.py
|
|
23
|
+
matter_server/common/helpers/__init__.py
|
|
24
|
+
matter_server/common/helpers/api.py
|
|
25
|
+
matter_server/common/helpers/json.py
|
|
26
|
+
matter_server/common/helpers/util.py
|
|
27
|
+
tests/test_client_integration.py
|
|
28
|
+
tests/test_imports.py
|
|
29
|
+
tests/test_integration.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
matter_server
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Python Client for the OHF Matter Server."""
|