zwave-js-server-python 0.53.1__tar.gz → 0.55.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. zwave-js-server-python-0.55.0/MANIFEST.in +1 -0
  2. zwave-js-server-python-0.55.0/PKG-INFO +262 -0
  3. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/README.md +4 -0
  4. zwave-js-server-python-0.55.0/pyproject.toml +128 -0
  5. zwave-js-server-python-0.55.0/setup.cfg +4 -0
  6. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/client.py +11 -3
  7. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/__init__.py +3 -4
  8. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/multilevel_sensor.py +92 -3
  9. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/notification.py +9 -3
  10. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/window_covering.py +2 -2
  11. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/event.py +2 -1
  12. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/controller/__init__.py +22 -9
  13. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/controller/data_model.py +2 -1
  14. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/controller/event_model.py +2 -2
  15. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/statistics.py +3 -3
  16. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/value.py +40 -1
  17. zwave-js-server-python-0.55.0/zwave_js_server_python.egg-info/PKG-INFO +262 -0
  18. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server_python.egg-info/SOURCES.txt +1 -9
  19. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server_python.egg-info/requires.txt +3 -0
  20. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server_python.egg-info/top_level.txt +1 -0
  21. zwave-js-server-python-0.53.1/PKG-INFO +0 -52
  22. zwave-js-server-python-0.53.1/pyproject.toml +0 -50
  23. zwave-js-server-python-0.53.1/setup.cfg +0 -25
  24. zwave-js-server-python-0.53.1/setup.py +0 -38
  25. zwave-js-server-python-0.53.1/test/test_client.py +0 -580
  26. zwave-js-server-python-0.53.1/test/test_dump.py +0 -120
  27. zwave-js-server-python-0.53.1/test/test_event.py +0 -12
  28. zwave-js-server-python-0.53.1/test/test_firmware.py +0 -158
  29. zwave-js-server-python-0.53.1/test/test_main.py +0 -75
  30. zwave-js-server-python-0.53.1/test/test_version.py +0 -33
  31. zwave-js-server-python-0.53.1/zwave_js_server_python.egg-info/PKG-INFO +0 -52
  32. zwave-js-server-python-0.53.1/zwave_js_server_python.egg-info/not-zip-safe +0 -1
  33. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/LICENSE +0 -0
  34. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/__init__.py +0 -0
  35. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/__main__.py +0 -0
  36. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/__init__.py +0 -0
  37. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/barrier_operator.py +0 -0
  38. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/basic.py +0 -0
  39. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/central_scene.py +0 -0
  40. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/color_switch.py +0 -0
  41. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/energy_production.py +0 -0
  42. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/entry_control.py +0 -0
  43. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/humidity_control.py +0 -0
  44. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/lock.py +0 -0
  45. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/meter.py +0 -0
  46. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/multilevel_switch.py +0 -0
  47. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/power_level.py +0 -0
  48. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/protection.py +0 -0
  49. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/scene_activation.py +0 -0
  50. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/sound_switch.py +0 -0
  51. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/thermostat.py +0 -0
  52. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/const/command_class/wake_up.py +0 -0
  53. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/dump.py +0 -0
  54. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/exceptions.py +0 -0
  55. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/firmware.py +0 -0
  56. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/__init__.py +0 -0
  57. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/association.py +0 -0
  58. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/command_class.py +0 -0
  59. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/controller/firmware.py +0 -0
  60. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/controller/inclusion_and_provisioning.py +0 -0
  61. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/controller/rebuild_routes.py +0 -0
  62. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/controller/statistics.py +0 -0
  63. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/device_class.py +0 -0
  64. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/device_config.py +0 -0
  65. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/driver.py +0 -0
  66. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/duration.py +0 -0
  67. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/endpoint.py +0 -0
  68. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/log_config.py +0 -0
  69. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/log_message.py +0 -0
  70. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/node/__init__.py +0 -0
  71. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/node/data_model.py +0 -0
  72. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/node/event_model.py +0 -0
  73. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/node/firmware.py +0 -0
  74. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/node/health_check.py +0 -0
  75. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/node/statistics.py +0 -0
  76. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/notification.py +0 -0
  77. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/utils.py +0 -0
  78. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/model/version.py +0 -0
  79. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/py.typed +0 -0
  80. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/__init__.py +0 -0
  81. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/command_class/__init__.py +0 -0
  82. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/command_class/energy_production.py +0 -0
  83. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/command_class/meter.py +0 -0
  84. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/command_class/multilevel_sensor.py +0 -0
  85. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/helpers.py +0 -0
  86. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/lock.py +0 -0
  87. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/multicast.py +0 -0
  88. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/util/node.py +0 -0
  89. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server/version.py +0 -0
  90. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server_python.egg-info/dependency_links.txt +0 -0
  91. {zwave-js-server-python-0.53.1 → zwave-js-server-python-0.55.0}/zwave_js_server_python.egg-info/entry_points.txt +0 -0
@@ -0,0 +1 @@
1
+ exclude test/*
@@ -0,0 +1,262 @@
1
+ Metadata-Version: 2.1
2
+ Name: zwave-js-server-python
3
+ Version: 0.55.0
4
+ Summary: Python wrapper for zwave-js-server
5
+ Author-email: Home Assistant Team <hello@home-assistant.io>
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "[]"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright [yyyy] [name of copyright owner]
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
207
+
208
+ Project-URL: Source Code, https://github.com/home-assistant-libs/zwave-js-server-python
209
+ Project-URL: Bug Reports, https://github.com/home-assistant-libs/zwave-js-server-python/issues
210
+ Keywords: home,automation,zwave,zwave-js
211
+ Classifier: Development Status :: 4 - Beta
212
+ Classifier: Intended Audience :: Developers
213
+ Classifier: Natural Language :: English
214
+ Classifier: Programming Language :: Python :: 3
215
+ Classifier: Programming Language :: Python :: 3.11
216
+ Classifier: Topic :: Home Automation
217
+ Requires-Python: >=3.11
218
+ Description-Content-Type: text/markdown
219
+ License-File: LICENSE
220
+ Requires-Dist: aiohttp>3
221
+ Requires-Dist: pydantic>=1.10.0
222
+ Provides-Extra: orjson
223
+ Requires-Dist: orjson>=3.9.9; extra == "orjson"
224
+
225
+ # zwave-js-server-python
226
+
227
+ Python library for communicating with [zwave-js-server](https://github.com/zwave-js/zwave-js-server/). Goal for this library is to replicate the structure and the events of Z-Wave JS 1:1. So it has a `Driver`, `Controller` and `Node` classes.
228
+
229
+ ## Setup development environment
230
+
231
+ To setup your development environment, run `scripts/setup`, which will install all requirements and set up pre-commit checks.
232
+
233
+ ## Trying it out
234
+
235
+ ```shell
236
+ python3 -m zwave_js_server ws://localhost:3000
237
+ ```
238
+
239
+ Or get the version of the server
240
+
241
+ ```shell
242
+ python3 -m zwave_js_server ws://localhost:3000 --server-version
243
+ ```
244
+
245
+ Or dump the state. Optionally add `--event-timeout 5` if you want to listen 5 seconds extra for events.
246
+
247
+ ```shell
248
+ python3 -m zwave_js_server ws://localhost:3000 --dump-state
249
+ ```
250
+
251
+ ## Sending commands
252
+
253
+ ```python
254
+ try:
255
+ result = await client.async_send_command({ "command": "start_listening" })
256
+ except zwave_js_server.client.FailedCommand as err:
257
+ print("Command failed with", err.error_code)
258
+ ```
259
+
260
+ ## Optional dependencies
261
+
262
+ `zwave-js-server-python` optionally supports `orjson` which can be installed with the `orjson` extra (e.g. `pip install zwave-js-server-python[orjson]`)
@@ -32,3 +32,7 @@ try:
32
32
  except zwave_js_server.client.FailedCommand as err:
33
33
  print("Command failed with", err.error_code)
34
34
  ```
35
+
36
+ ## Optional dependencies
37
+
38
+ `zwave-js-server-python` optionally supports `orjson` which can be installed with the `orjson` extra (e.g. `pip install zwave-js-server-python[orjson]`)
@@ -0,0 +1,128 @@
1
+ [build-system]
2
+ requires = ["setuptools"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "zwave-js-server-python"
7
+ authors = [{ name = "Home Assistant Team", email = "hello@home-assistant.io" }]
8
+ description = "Python wrapper for zwave-js-server"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { file = "LICENSE" }
12
+ keywords = ["home", "automation", "zwave", "zwave-js"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "Natural Language :: English",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Topic :: Home Automation",
20
+ ]
21
+ dependencies = ["aiohttp>3", "pydantic>=1.10.0"]
22
+ dynamic = ["version"]
23
+
24
+ [project.optional-dependencies]
25
+ orjson = ["orjson>=3.9.9"]
26
+
27
+ [project.scripts]
28
+ zwave-js-server-python = "zwave_js_server.__main__:main"
29
+
30
+ [project.urls]
31
+ "Source Code" = "https://github.com/home-assistant-libs/zwave-js-server-python"
32
+ "Bug Reports" = "https://github.com/home-assistant-libs/zwave-js-server-python/issues"
33
+
34
+ [tool.setuptools.dynamic]
35
+ version = { attr = "zwave_js_server.const.__version__" }
36
+
37
+ [tool.setuptools.packages.find]
38
+ exclude = ["test", "test.*", "scripts"]
39
+
40
+ [tool.setuptools.package-data]
41
+ zwave_js_server = ["py.typed"]
42
+
43
+ [tool.mypy]
44
+ plugins = ["pydantic.mypy"]
45
+ follow_imports = "skip"
46
+ ignore_missing_imports = true
47
+ check_untyped_defs = true
48
+ disallow_incomplete_defs = true
49
+ disallow_untyped_calls = true
50
+ disallow_untyped_defs = true
51
+ warn_return_any = false
52
+ warn_unreachable = true
53
+ warn_unused_ignores = true
54
+ warn_incomplete_stub = true
55
+ warn_redundant_casts = true
56
+ warn_unused_configs = true
57
+
58
+ [[tool.mypy.overrides]]
59
+ module = "mypy-test.*"
60
+ ignore_errors = true
61
+
62
+ [tool.pylint.MAIN]
63
+ disable = [
64
+ "duplicate-code",
65
+ "fixme",
66
+ "locally-disabled",
67
+ "too-few-public-methods",
68
+ "too-many-public-methods",
69
+ "too-many-lines",
70
+ ]
71
+ enable = ["useless-suppression", "use-symbolic-message-instead"]
72
+ extension-pkg-allow-list = "pydantic"
73
+ fail-on = ["I"]
74
+ ignore = ["test"]
75
+ jobs = 2
76
+ load-plugins = ["pylint_strict_informational"]
77
+ persistent = "no"
78
+ score = "no"
79
+
80
+ [tool.pylint.BASIC]
81
+ good-names = ["id", "i", "j", "k", "ex", "Run", "_", "fp"]
82
+
83
+ [tool.pylint.DESIGN]
84
+ max-args = 9
85
+ max-attributes = 15
86
+
87
+ [tool.pylint.FORMAT]
88
+ expected-line-ending-format = "LF"
89
+
90
+ [tool.pytest.ini_options]
91
+ asyncio_mode = "auto"
92
+
93
+ [tool.ruff]
94
+ select = ["D", "E", "F", "G", "I", "PLC", "PLE", "PLR", "PLW", "UP", "W"]
95
+ ignore = [
96
+ "D202",
97
+ "D212",
98
+ "D203",
99
+ "D213",
100
+ "E501",
101
+ "PLR0911", # Too many return statements ({returns} > {max_returns})
102
+ "PLR0912", # Too many branches ({branches} > {max_branches})
103
+ "PLR0913", # Too many arguments to function call ({c_args} > {max_args})
104
+ "PLR0915", # Too many statements ({statements} > {max_statements})
105
+ "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
106
+ "PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target
107
+ "UP006", # keep type annotation style as is
108
+ "UP007", # keep type annotation style as is
109
+ ]
110
+ exclude = [
111
+ ".venv",
112
+ ".git",
113
+ ".tox",
114
+ "docs",
115
+ "venv",
116
+ "bin",
117
+ "lib",
118
+ "deps",
119
+ "build",
120
+ ]
121
+ line-length = 88
122
+
123
+ [tool.ruff.isort]
124
+ force-sort-within-sections = true
125
+ known-first-party = ["zwave_js_server"]
126
+ combine-as-imports = true
127
+ split-on-trailing-comma = false
128
+ case-sensitive = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -6,6 +6,7 @@ from collections import defaultdict
6
6
  from collections.abc import Callable
7
7
  from copy import deepcopy
8
8
  from datetime import datetime
9
+ import functools
9
10
  import logging
10
11
  from operator import itemgetter
11
12
  import pprint
@@ -39,6 +40,11 @@ from .model.driver import Driver
39
40
  from .model.log_message import LogMessage
40
41
  from .model.version import VersionInfo, VersionInfoDataType
41
42
 
43
+ try:
44
+ import orjson as json
45
+ except ImportError:
46
+ import json
47
+
42
48
  SIZE_PARSE_JSON_EXECUTOR = 8192
43
49
 
44
50
  # Message IDs
@@ -458,9 +464,11 @@ class Client:
458
464
 
459
465
  try:
460
466
  if len(msg.data) > SIZE_PARSE_JSON_EXECUTOR:
461
- data: dict = await self._loop.run_in_executor(None, msg.json)
467
+ data: dict = await self._loop.run_in_executor(
468
+ None, functools.partial(msg.json, loads=json.loads)
469
+ )
462
470
  else:
463
- data = msg.json()
471
+ data = msg.json(loads=json.loads)
464
472
  except ValueError as err:
465
473
  raise InvalidMessage("Received invalid JSON.") from err
466
474
 
@@ -557,7 +565,7 @@ class Client:
557
565
  }
558
566
  )
559
567
 
560
- await self._client.send_json(message)
568
+ await self._client.send_json(message, dumps=json.dumps)
561
569
 
562
570
  async def __aenter__(self) -> Client:
563
571
  """Connect to the websocket."""
@@ -3,17 +3,16 @@ from __future__ import annotations
3
3
 
4
4
  from dataclasses import dataclass, field
5
5
  from enum import Enum, IntEnum
6
- from importlib import metadata
7
6
  import logging
8
7
  from typing import TypedDict
9
8
 
10
9
  PACKAGE_NAME = "zwave-js-server-python"
11
- __version__ = metadata.version(PACKAGE_NAME)
10
+ __version__ = "0.55.0"
12
11
 
13
12
  # minimal server schema version we can handle
14
- MIN_SERVER_SCHEMA_VERSION = 33
13
+ MIN_SERVER_SCHEMA_VERSION = 34
15
14
  # max server schema version we can handle (and our code is compatible with)
16
- MAX_SERVER_SCHEMA_VERSION = 33
15
+ MAX_SERVER_SCHEMA_VERSION = 34
17
16
 
18
17
  VALUE_UNKNOWN = "unknown"
19
18
 
@@ -12,6 +12,95 @@ from enum import IntEnum
12
12
  CC_SPECIFIC_SCALE = "scale"
13
13
  CC_SPECIFIC_SENSOR_TYPE = "sensorType"
14
14
 
15
+ ACCELERATION_X_AXIS_PROPERTY = "Acceleration X-axis"
16
+ ACCELERATION_Y_AXIS_PROPERTY = "Acceleration Y-axis"
17
+ ACCELERATION_Z_AXIS_PROPERTY = "Acceleration Z-axis"
18
+ AIR_FLOW_PROPERTY = "Air flow"
19
+ AIR_TEMPERATURE_PROPERTY = "Air temperature"
20
+ AMMONIA_PROPERTY = "Ammonia"
21
+ ANGLE_POSITION_PROPERTY = "Angle position"
22
+ APPLIED_FORCE_ON_THE_SENSOR_PROPERTY = "Applied force on the sensor"
23
+ ATMOSPHERIC_PRESSURE_PROPERTY = "Atmospheric pressure"
24
+ BAROMETRIC_PRESSURE_PROPERTY = "Barometric pressure"
25
+ BASIS_METABOLIC_RATE_PROPERTY = "Basis metabolic rate (BMR)"
26
+ BLOOD_PRESSURE_PROPERTY = "Blood pressure"
27
+ BODY_MASS_INDEX_PROPERTY = "Body Mass Index (BMI)"
28
+ BOILER_WATER_TEMPERATURE_PROPERTY = "Boiler water temperature"
29
+ BONE_MASS_PROPERTY = "Bone mass"
30
+ CARBON_DIOXIDE_LEVEL_PROPERTY = "Carbon dioxide (CO₂) level"
31
+ CARBON_MONOXIDE_LEVEL_PROPERTY = "Carbon monoxide (CO) level"
32
+ CONDENSER_COIL_TEMPERATURE_PROPERTY = "Condenser Coil temperature"
33
+ CURRENT_PROPERTY = "Current"
34
+ DEFROST_TEMPERATURE_PROPERTY = "Defrost temperature"
35
+ DEW_POINT_PROPERTY = "Dew point"
36
+ DIRECTION_PROPERTY = "Direction"
37
+ DISCHARGE_LINE_TEMPERATURE_PROPERTY = "Discharge Line temperature"
38
+ DISCHARGE_PRESSURE_PROPERTY = "Discharge Pressure"
39
+ DISTANCE_PROPERTY = "Distance"
40
+ DOMESTIC_HOT_WATER_TEMPERATURE_PROPERTY = "Domestic Hot Water (DHW) temperature"
41
+ ELECTRICAL_CONDUCTIVITY_PROPERTY = "Electrical conductivity"
42
+ ELECTRICAL_RESISTIVITY_PROPERTY = "Electrical resistivity"
43
+ EVAPORATOR_COIL_TEMPERATURE_PROPERTY = "Evaporator Coil temperature"
44
+ EXHAUST_TEMPERATURE_PROPERTY = "Exhaust temperature"
45
+ FAT_MASS_PROPERTY = "Fat mass"
46
+ FORMALDEHYDE_LEVEL_PROPERTY = "Formaldehyde (CH₂O) level"
47
+ FREQUENCY_PROPERTY = "Frequency"
48
+ GENERAL_PURPOSE_PROPERTY = "General purpose"
49
+ HEART_RATE_PROPERTY = "Heart rate"
50
+ HEART_RATE_LF_HF_RATIO_PROPERTY = "Heart Rate LF/HF ratio"
51
+ HUMIDITY_PROPERTY = "Humidity"
52
+ ILLUMINANCE_PROPERTY = "Illuminance"
53
+ LEAD_PROPERTY = "Lead"
54
+ LIQUID_LINE_TEMPERATURE_PROPERTY = "Liquid Line temperature"
55
+ LOUDNESS_PROPERTY = "Loudness"
56
+ METHANE_DENSITY_PROPERTY = "Methane (CH₄) density"
57
+ MOISTURE_PROPERTY = "Moisture"
58
+ MOTION_DIRECTION_PROPERTY = "Motion Direction"
59
+ MUSCLE_MASS_PROPERTY = "Muscle mass"
60
+ NITROGEN_DIOXIDE_PROPERTY = "Nitrogen dioxide"
61
+ OUTSIDE_TEMPERATURE_PROPERTY = "Outside temperature"
62
+ OZONE_PROPERTY = "Ozone"
63
+ PARTICULATE_MATTER_1_PROPERTY = "Particulate Matter 1"
64
+ PARTICULATE_MATTER_10_PROPERTY = "Particulate Matter 10"
65
+ PARTICULATE_MATTER_2_5_PROPERTY = "Particulate Matter 2.5"
66
+ PERSON_COUNTER_ENTERING_PROPERTY = "Person counter (entering)"
67
+ PERSON_COUNTER_EXITING_PROPERTY = "Person counter (exiting)"
68
+ POWER_PROPERTY = "Power"
69
+ RADON_CONCENTRATION_PROPERTY = "Radon concentration"
70
+ RAIN_RATE_PROPERTY = "Rain rate"
71
+ RELATIVE_MODULATION_LEVEL_PROPERTY = "Relative Modulation level"
72
+ RESPIRATORY_RATE_PROPERTY = "Respiratory rate"
73
+ RETURN_AIR_TEMPERATURE_PROPERTY = "Return Air temperature"
74
+ RF_SIGNAL_STRENGTH_PROPERTY = "RF signal strength"
75
+ ROTATION_PROPERTY = "Rotation"
76
+ SEISMIC_INTENSITY_PROPERTY = "Seismic Intensity"
77
+ SEISMIC_MAGNITUDE_PROPERTY = "Seismic magnitude"
78
+ SMOKE_DENSITY_PROPERTY = "Smoke density"
79
+ SOIL_HUMIDITY_PROPERTY = "Soil humidity"
80
+ SOIL_REACTIVITY_PROPERTY = "Soil reactivity"
81
+ SOIL_SALINITY_PROPERTY = "Soil salinity"
82
+ SOIL_TEMPERATURE_PROPERTY = "Soil temperature"
83
+ SOLAR_RADIATION_PROPERTY = "Solar radiation"
84
+ SUCTION_PRESSURE_PROPERTY = "Suction Pressure"
85
+ SULFUR_DIOXIDE_PROPERTY = "Sulfur dioxide"
86
+ SUPPLY_AIR_TEMPERATURE_PROPERTY = "Supply Air temperature"
87
+ TANK_CAPACITY_PROPERTY = "Tank capacity"
88
+ TARGET_TEMPERATURE_PROPERTY = "Target temperature"
89
+ TIDE_LEVEL_PROPERTY = "Tide level"
90
+ TIME_PROPERTY = "Time"
91
+ TOTAL_BODY_WATER_PROPERTY = "Total body water (TBW)"
92
+ ULTRAVIOLET_PROPERTY = "Ultraviolet"
93
+ VELOCITY_PROPERTY = "Velocity"
94
+ VOLATILE_ORGANIC_COMPOUND_LEVEL_PROPERTY = "Volatile Organic Compound level"
95
+ VOLTAGE_PROPERTY = "Voltage"
96
+ WATER_ACIDITY_PROPERTY = "Water acidity"
97
+ WATER_CHLORINE_LEVEL_PROPERTY = "Water Chlorine level"
98
+ WATER_FLOW_PROPERTY = "Water flow"
99
+ WATER_OXIDATION_REDUCTION_POTENTIAL_PROPERTY = "Water Oxidation reduction potential"
100
+ WATER_PRESSURE_PROPERTY = "Water pressure"
101
+ WATER_TEMPERATURE_PROPERTY = "Water temperature"
102
+ WEIGHT_PROPERTY = "Weight"
103
+
15
104
 
16
105
  class MultilevelSensorType(IntEnum):
17
106
  """Enum for known multilevel sensor types."""
@@ -786,9 +875,9 @@ UNIT_WATT_PER_SQUARE_METER: list[MultilevelSensorScaleType] = [
786
875
 
787
876
  # ----------------------------------------------------------------------------------- #
788
877
  # **END OF AUTOGENERATED CONTENT** (DO NOT EDIT/REMOVE THIS COMMENT BLOCK AND DO NOT #
789
- # EDIT ANYTHING ABOVE IT. IF A NEW IMPORT IS NEEDED, UPDATE THE LINES AROUND 135 #
790
- # IN scripts/generate_multilevel_sensor_constants.py THEN RE-RUN THE SCRIPT. ALL #
791
- # LINES WRITTEN BELOW THIS BLOCK WILL BE PRESERVED AS LONG AS THIS BLOCK REMAINS) #
878
+ # EDIT ANYTHING ABOVE IT. IF A NEW IMPORT IS NEEDED, ADD IT TO THE IMPORTS IN THE #
879
+ # CORRESPONDING GENERATION SCRIPT THEN RE-RUN THE SCRIPT. LINES WRITTEN BELOW THIS #
880
+ # BLOCK WILL BE PRESERVED AS LONG AS THIS BLOCK REMAINS) #
792
881
  # ----------------------------------------------------------------------------------- #
793
882
 
794
883
  CO_SENSORS = [MultilevelSensorType.CARBON_MONOXIDE_LEVEL]
@@ -17,6 +17,7 @@ class NotificationType(IntEnum):
17
17
  """Enum for known notification types."""
18
18
 
19
19
  # https://github.com/zwave-js/node-zwave-js/blob/master/packages/config/config/notifications.json
20
+ UNKNOWN = -1
20
21
  ACCESS_CONTROL = 6
21
22
  APPLIANCE = 12
22
23
  CLOCK = 11
@@ -40,6 +41,11 @@ class NotificationType(IntEnum):
40
41
  WATER_VALVE = 15
41
42
  WEATHER_ALARM = 16
42
43
 
44
+ @classmethod
45
+ def _missing_(cls: type, value: object) -> NotificationType: # noqa: ARG003
46
+ """Set default enum member if an unknown value is provided."""
47
+ return NotificationType.UNKNOWN
48
+
43
49
 
44
50
  class NotificationEvent(IntEnum):
45
51
  """Common base class for Notification CC states enums."""
@@ -940,7 +946,7 @@ NOTIFICATION_EVENT_TO_EVENT_VALUE_MAP: dict[
940
946
 
941
947
  # ----------------------------------------------------------------------------------- #
942
948
  # **END OF AUTOGENERATED CONTENT** (DO NOT EDIT/REMOVE THIS COMMENT BLOCK AND DO NOT #
943
- # EDIT ANYTHING ABOVE IT. IF A NEW IMPORT IS NEEDED, UPDATE THE LINES AROUND 135 #
944
- # IN scripts/generate_multilevel_sensor_constants.py THEN RE-RUN THE SCRIPT. ALL #
945
- # LINES WRITTEN BELOW THIS BLOCK WILL BE PRESERVED AS LONG AS THIS BLOCK REMAINS) #
949
+ # EDIT ANYTHING ABOVE IT. IF A NEW IMPORT IS NEEDED, ADD IT TO THE IMPORTS IN THE #
950
+ # CORRESPONDING GENERATION SCRIPT THEN RE-RUN THE SCRIPT. LINES WRITTEN BELOW THIS #
951
+ # BLOCK WILL BE PRESERVED AS LONG AS THIS BLOCK REMAINS) #
946
952
  # ----------------------------------------------------------------------------------- #
@@ -4,8 +4,8 @@ from __future__ import annotations
4
4
  from enum import IntEnum
5
5
 
6
6
  NO_POSITION_SUFFIX = "(no position)"
7
- WINDOW_COVERING_OPEN_PROPERTY = "open"
8
- WINDOW_COVERING_CLOSE_PROPERTY = "close"
7
+ WINDOW_COVERING_LEVEL_CHANGE_DOWN_PROPERTY = "levelChangeDown"
8
+ WINDOW_COVERING_LEVEL_CHANGE_UP_PROPERTY = "levelChangeUp"
9
9
 
10
10
 
11
11
  class WindowCoveringPropertyKey(IntEnum):
@@ -1,9 +1,10 @@
1
1
  """Provide Event base classes for Z-Wave JS."""
2
2
  from __future__ import annotations
3
3
 
4
+ from collections.abc import Callable
4
5
  from dataclasses import dataclass, field
5
6
  import logging
6
- from typing import Callable, Literal
7
+ from typing import Literal
7
8
 
8
9
  try:
9
10
  from pydantic.v1 import BaseModel