matter-python-client 0.4.1a0.dev20260220__tar.gz → 0.4.3__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 (33) hide show
  1. matter_python_client-0.4.3/PKG-INFO +106 -0
  2. matter_python_client-0.4.3/matter_python_client.egg-info/PKG-INFO +106 -0
  3. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/custom_clusters.py +4 -4
  4. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/pyproject.toml +8 -1
  5. matter_python_client-0.4.1a0.dev20260220/PKG-INFO +0 -20
  6. matter_python_client-0.4.1a0.dev20260220/matter_python_client.egg-info/PKG-INFO +0 -20
  7. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/README.md +0 -0
  8. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_python_client.egg-info/SOURCES.txt +0 -0
  9. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_python_client.egg-info/dependency_links.txt +0 -0
  10. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_python_client.egg-info/not-zip-safe +0 -0
  11. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_python_client.egg-info/requires.txt +0 -0
  12. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_python_client.egg-info/top_level.txt +0 -0
  13. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/__init__.py +0 -0
  14. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/client/__init__.py +0 -0
  15. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/client/client.py +0 -0
  16. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/client/connection.py +0 -0
  17. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/client/exceptions.py +0 -0
  18. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/client/models/__init__.py +0 -0
  19. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/client/models/device_types.py +0 -0
  20. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/client/models/node.py +0 -0
  21. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/__init__.py +0 -0
  22. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/const.py +0 -0
  23. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/errors.py +0 -0
  24. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/helpers/__init__.py +0 -0
  25. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/helpers/api.py +0 -0
  26. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/helpers/json.py +0 -0
  27. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/helpers/util.py +0 -0
  28. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/common/models.py +0 -0
  29. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/matter_server/py.typed +0 -0
  30. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/setup.cfg +0 -0
  31. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/tests/test_client_integration.py +0 -0
  32. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/tests/test_imports.py +0 -0
  33. {matter_python_client-0.4.1a0.dev20260220 → matter_python_client-0.4.3}/tests/test_integration.py +0 -0
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.4
2
+ Name: matter-python-client
3
+ Version: 0.4.3
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,106 @@
1
+ Metadata-Version: 2.4
2
+ Name: matter-python-client
3
+ Version: 0.4.3
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`
@@ -1002,7 +1002,7 @@ class ThirdRealityMeteringCluster(Cluster, CustomClusterMixin):
1002
1002
  Label="currentSummationDelivered", Tag=0x0000, Type=uint
1003
1003
  ),
1004
1004
  ClusterObjectFieldDescriptor(
1005
- Label="instantaneousDemand", Tag=0x0400, Type=uint
1005
+ Label="instantaneousDemand", Tag=0x0400, Type=int
1006
1006
  ),
1007
1007
  ClusterObjectFieldDescriptor(Label="multiplier", Tag=0x0301, Type=uint),
1008
1008
  ClusterObjectFieldDescriptor(Label="divisor", Tag=0x0302, Type=uint),
@@ -1010,7 +1010,7 @@ class ThirdRealityMeteringCluster(Cluster, CustomClusterMixin):
1010
1010
  )
1011
1011
 
1012
1012
  currentSummationDelivered: uint | None = None
1013
- instantaneousDemand: uint | None = None
1013
+ instantaneousDemand: int | None = None
1014
1014
  multiplier: uint = 1
1015
1015
  divisor: uint = 1
1016
1016
 
@@ -1116,9 +1116,9 @@ class ThirdRealityMeteringCluster(Cluster, CustomClusterMixin):
1116
1116
  @ChipUtility.classproperty
1117
1117
  def attribute_type(cls) -> ClusterObjectFieldDescriptor:
1118
1118
  """Return attribute type."""
1119
- return ClusterObjectFieldDescriptor(Type=uint)
1119
+ return ClusterObjectFieldDescriptor(Type=int)
1120
1120
 
1121
- value: uint = 0
1121
+ value: int = 0
1122
1122
 
1123
1123
 
1124
1124
  @dataclass
@@ -23,8 +23,15 @@ dependencies = [
23
23
  description = "Python Client for the OHF Matter Server"
24
24
  license = "Apache-2.0"
25
25
  name = "matter-python-client"
26
+ readme = "README.md"
26
27
  requires-python = ">=3.12"
27
- version = "0.4.1a0.dev20260220"
28
+ version = "0.4.3"
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/matter-js/matterjs-server"
32
+ Source = "https://github.com/matter-js/matterjs-server/tree/main/python_client"
33
+ "Bug Tracker" = "https://github.com/matter-js/matterjs-server/issues"
34
+ Changelog = "https://github.com/matter-js/matterjs-server/blob/main/CHANGELOG.md"
28
35
 
29
36
  [project.optional-dependencies]
30
37
  test = [
@@ -1,20 +0,0 @@
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"
@@ -1,20 +0,0 @@
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"