matter-python-client 0.4.1a0.dev20260220__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 (31) hide show
  1. matter_python_client-0.4.1a0.dev20260220/PKG-INFO +20 -0
  2. matter_python_client-0.4.1a0.dev20260220/README.md +80 -0
  3. matter_python_client-0.4.1a0.dev20260220/matter_python_client.egg-info/PKG-INFO +20 -0
  4. matter_python_client-0.4.1a0.dev20260220/matter_python_client.egg-info/SOURCES.txt +29 -0
  5. matter_python_client-0.4.1a0.dev20260220/matter_python_client.egg-info/dependency_links.txt +1 -0
  6. matter_python_client-0.4.1a0.dev20260220/matter_python_client.egg-info/not-zip-safe +1 -0
  7. matter_python_client-0.4.1a0.dev20260220/matter_python_client.egg-info/requires.txt +8 -0
  8. matter_python_client-0.4.1a0.dev20260220/matter_python_client.egg-info/top_level.txt +1 -0
  9. matter_python_client-0.4.1a0.dev20260220/matter_server/__init__.py +1 -0
  10. matter_python_client-0.4.1a0.dev20260220/matter_server/client/__init__.py +5 -0
  11. matter_python_client-0.4.1a0.dev20260220/matter_server/client/client.py +806 -0
  12. matter_python_client-0.4.1a0.dev20260220/matter_server/client/connection.py +177 -0
  13. matter_python_client-0.4.1a0.dev20260220/matter_server/client/exceptions.py +63 -0
  14. matter_python_client-0.4.1a0.dev20260220/matter_server/client/models/__init__.py +1 -0
  15. matter_python_client-0.4.1a0.dev20260220/matter_server/client/models/device_types.py +952 -0
  16. matter_python_client-0.4.1a0.dev20260220/matter_server/client/models/node.py +414 -0
  17. matter_python_client-0.4.1a0.dev20260220/matter_server/common/__init__.py +1 -0
  18. matter_python_client-0.4.1a0.dev20260220/matter_server/common/const.py +8 -0
  19. matter_python_client-0.4.1a0.dev20260220/matter_server/common/custom_clusters.py +1371 -0
  20. matter_python_client-0.4.1a0.dev20260220/matter_server/common/errors.py +94 -0
  21. matter_python_client-0.4.1a0.dev20260220/matter_server/common/helpers/__init__.py +0 -0
  22. matter_python_client-0.4.1a0.dev20260220/matter_server/common/helpers/api.py +70 -0
  23. matter_python_client-0.4.1a0.dev20260220/matter_server/common/helpers/json.py +48 -0
  24. matter_python_client-0.4.1a0.dev20260220/matter_server/common/helpers/util.py +359 -0
  25. matter_python_client-0.4.1a0.dev20260220/matter_server/common/models.py +273 -0
  26. matter_python_client-0.4.1a0.dev20260220/matter_server/py.typed +0 -0
  27. matter_python_client-0.4.1a0.dev20260220/pyproject.toml +54 -0
  28. matter_python_client-0.4.1a0.dev20260220/setup.cfg +4 -0
  29. matter_python_client-0.4.1a0.dev20260220/tests/test_client_integration.py +98 -0
  30. matter_python_client-0.4.1a0.dev20260220/tests/test_imports.py +125 -0
  31. matter_python_client-0.4.1a0.dev20260220/tests/test_integration.py +1140 -0
@@ -0,0 +1,20 @@
1
+ Metadata-Version: 2.4
2
+ Name: matter-python-client
3
+ Version: 0.4.1a0.dev20260220
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
+ Platform: any
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Topic :: Home Automation
13
+ Requires-Python: >=3.12
14
+ Requires-Dist: aiohttp
15
+ Requires-Dist: orjson
16
+ Requires-Dist: home-assistant-chip-clusters==2025.7.0
17
+ Provides-Extra: test
18
+ Requires-Dist: pytest>=9.0; extra == "test"
19
+ Requires-Dist: pytest-asyncio>=0.24; extra == "test"
20
+ Requires-Dist: pytest-aiohttp>=1.0; extra == "test"
@@ -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,20 @@
1
+ Metadata-Version: 2.4
2
+ Name: matter-python-client
3
+ Version: 0.4.1a0.dev20260220
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
+ Platform: any
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Topic :: Home Automation
13
+ Requires-Python: >=3.12
14
+ Requires-Dist: aiohttp
15
+ Requires-Dist: orjson
16
+ Requires-Dist: home-assistant-chip-clusters==2025.7.0
17
+ Provides-Extra: test
18
+ Requires-Dist: pytest>=9.0; extra == "test"
19
+ Requires-Dist: pytest-asyncio>=0.24; extra == "test"
20
+ Requires-Dist: pytest-aiohttp>=1.0; extra == "test"
@@ -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,8 @@
1
+ aiohttp
2
+ orjson
3
+ home-assistant-chip-clusters==2025.7.0
4
+
5
+ [test]
6
+ pytest>=9.0
7
+ pytest-asyncio>=0.24
8
+ pytest-aiohttp>=1.0
@@ -0,0 +1 @@
1
+ """Python Client for the OHF Matter Server."""
@@ -0,0 +1,5 @@
1
+ """Client for the MatterServer."""
2
+
3
+ from .client import MatterClient
4
+
5
+ __all__ = ["MatterClient"]