matter-python-client 0.4.1__py3-none-any.whl

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,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,22 @@
1
+ matter_server/__init__.py,sha256=lJ6xyVLSMGtiHvq36VPSDb75ksxfNKYmKEEE-ZwJdhQ,47
2
+ matter_server/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ matter_server/client/__init__.py,sha256=pZzjJp-7C5BmYGZJjIo5SpyjGLU0FcqBa2nJ558y-Is,97
4
+ matter_server/client/client.py,sha256=6zcVKB0UkxFl3mYeK66GN6gBVq8tciIDQkLZB2piYwk,30438
5
+ matter_server/client/connection.py,sha256=ye7jbDHpHuBXfJPnBiO8tsQN0A4SiyOh98V4H-2D8cc,6180
6
+ matter_server/client/exceptions.py,sha256=741JkGMBQFJYZ70zX80B-Dn_NtgHffb6jDHC83tCL2U,1901
7
+ matter_server/client/models/__init__.py,sha256=pT16UC2evZVw2trjun2xJZpaOR55ky7i_8znlA3Mreo,63
8
+ matter_server/client/models/device_types.py,sha256=vwsCU0OJuAnOycqWGbn-l6eBY4yOsiS3B9FDgFrzlgk,23341
9
+ matter_server/client/models/node.py,sha256=MF4YwWWG7bGIJeh9COBTYc9PoqHbHkFPP1hFS6D7KqU,15420
10
+ matter_server/common/__init__.py,sha256=y4EeCH05sUYifS2b624oweA6omnY5k-rLNHHv4t4p7Q,50
11
+ matter_server/common/const.py,sha256=hTu0siAgpQvAz6oYavTGuqgkXaQH2glQxUQuGyPnn1o,256
12
+ matter_server/common/custom_clusters.py,sha256=wT8xYa1zSKeGBTI15j9mG_ch8w-e7ktGECzmhdJdPgE,48276
13
+ matter_server/common/errors.py,sha256=ryZQXg3cS8g0aBt-6r1y0q4LO7D-gl-GZFRlv0IIuNo,2154
14
+ matter_server/common/models.py,sha256=nuhvQoE0T5Qj6kgqtbSDoOvnH-_Uv4tFqIK0UPJchbU,7689
15
+ matter_server/common/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ matter_server/common/helpers/api.py,sha256=ePJjzR0KhdWrXtfiXJGOZbq__DUVcv1zR5xC9no9w-o,2039
17
+ matter_server/common/helpers/json.py,sha256=6JZb9gS6z9oMHB9gUQ0DrMYF_wdyC6QpyW4jHm7lE3w,1306
18
+ matter_server/common/helpers/util.py,sha256=QQ4-rvJNi6mJN4WVSnQSjiigFy8DEyZtAuZOWYpv1yc,12883
19
+ matter_python_client-0.4.1.dist-info/METADATA,sha256=yQh_89kQo3vFtcjVp7pm7NWDCPAMT7VBys7DnjdXOI4,4152
20
+ matter_python_client-0.4.1.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
21
+ matter_python_client-0.4.1.dist-info/top_level.txt,sha256=RnN_dXPV-BJticdofUc0tEiC3yaXXPKKCIy5ApS7nn8,14
22
+ matter_python_client-0.4.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ matter_server
@@ -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"]