zwave-js-server-python 0.56.0__py3-none-any.whl → 0.57.0__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.
@@ -8,12 +8,12 @@ import logging
8
8
  from typing import TypedDict
9
9
 
10
10
  PACKAGE_NAME = "zwave-js-server-python"
11
- __version__ = "0.56.0"
11
+ __version__ = "0.57.0"
12
12
 
13
13
  # minimal server schema version we can handle
14
- MIN_SERVER_SCHEMA_VERSION = 35
14
+ MIN_SERVER_SCHEMA_VERSION = 36
15
15
  # max server schema version we can handle (and our code is compatible with)
16
- MAX_SERVER_SCHEMA_VERSION = 35
16
+ MAX_SERVER_SCHEMA_VERSION = 36
17
17
 
18
18
  VALUE_UNKNOWN = "unknown"
19
19
 
@@ -5,6 +5,7 @@ from __future__ import annotations
5
5
  from enum import IntEnum
6
6
 
7
7
  VALUE_PROPERTY = "value"
8
+ RESET_PROPERTY = "reset"
8
9
 
9
10
  CC_SPECIFIC_SCALE = "scale"
10
11
  CC_SPECIFIC_METER_TYPE = "meterType"
@@ -76,13 +76,13 @@ class ProvisioningEntry:
76
76
  security_classes=[
77
77
  SecurityClass(sec_cls) for sec_cls in data["securityClasses"]
78
78
  ],
79
- additional_properties={
80
- k: v
81
- for k, v in data.items()
82
- if k
83
- not in {"dsk", "securityClasses", "requestedSecurityClasses", "status"}
84
- },
85
79
  )
80
+ if additional_properties := {
81
+ k: v
82
+ for k, v in data.items()
83
+ if k not in ("dsk", "securityClasses", "requestedSecurityClasses", "status")
84
+ }:
85
+ cls_instance.additional_properties = additional_properties
86
86
  if "requestedSecurityClasses" in data:
87
87
  cls_instance.requested_security_classes = [
88
88
  SecurityClass(sec_cls) for sec_cls in data["requestedSecurityClasses"]
@@ -148,6 +148,12 @@ class QRProvisioningInformation(ProvisioningEntry, QRProvisioningInformationMixi
148
148
  @classmethod
149
149
  def from_dict(cls, data: dict[str, Any]) -> QRProvisioningInformation:
150
150
  """Return QRProvisioningInformation from data dict."""
151
+ supported_protocols: list[Protocols] | None = None
152
+ if "supportedProtocols" in data:
153
+ supported_protocols = [
154
+ Protocols(supported_protocol)
155
+ for supported_protocol in data["supportedProtocols"]
156
+ ]
151
157
  cls_instance = cls(
152
158
  version=QRCodeVersion(data["version"]),
153
159
  security_classes=[
@@ -163,33 +169,31 @@ class QRProvisioningInformation(ProvisioningEntry, QRProvisioningInformationMixi
163
169
  application_version=data["applicationVersion"],
164
170
  max_inclusion_request_interval=data.get("maxInclusionRequestInterval"),
165
171
  uuid=data.get("uuid"),
166
- supported_protocols=[
167
- Protocols(supported_protocol)
168
- for supported_protocol in data.get("supportedProtocols", [])
169
- ],
170
- additional_properties={
171
- k: v
172
- for k, v in data.items()
173
- if k
174
- not in {
175
- "version",
176
- "securityClasses",
177
- "requestedSecurityClasses",
178
- "dsk",
179
- "genericDeviceClass",
180
- "specificDeviceClass",
181
- "installerIconType",
182
- "manufacturerId",
183
- "productType",
184
- "productId",
185
- "applicationVersion",
186
- "maxInclusionRequestInterval",
187
- "uuid",
188
- "supportedProtocols",
189
- "status",
190
- }
191
- },
172
+ supported_protocols=supported_protocols,
192
173
  )
174
+ if additional_properties := {
175
+ k: v
176
+ for k, v in data.items()
177
+ if k
178
+ not in (
179
+ "version",
180
+ "securityClasses",
181
+ "requestedSecurityClasses",
182
+ "dsk",
183
+ "genericDeviceClass",
184
+ "specificDeviceClass",
185
+ "installerIconType",
186
+ "manufacturerId",
187
+ "productType",
188
+ "productId",
189
+ "applicationVersion",
190
+ "maxInclusionRequestInterval",
191
+ "uuid",
192
+ "supportedProtocols",
193
+ "status",
194
+ )
195
+ }:
196
+ cls_instance.additional_properties = additional_properties
193
197
  if "requestedSecurityClasses" in data:
194
198
  cls_instance.requested_security_classes = [
195
199
  SecurityClass(sec_cls) for sec_cls in data["requestedSecurityClasses"]
@@ -23,8 +23,6 @@ class DeviceClassDataType(TypedDict):
23
23
  basic: DeviceClassItemDataType
24
24
  generic: DeviceClassItemDataType
25
25
  specific: DeviceClassItemDataType
26
- mandatorySupportedCCs: list[int]
27
- mandatoryControlledCCs: list[int]
28
26
 
29
27
 
30
28
  @dataclass
@@ -43,8 +41,6 @@ class DeviceClass:
43
41
  self._basic = DeviceClassItem(**data["basic"])
44
42
  self._generic = DeviceClassItem(**data["generic"])
45
43
  self._specific = DeviceClassItem(**data["specific"])
46
- self._mandatory_supported_ccs: list[int] = data["mandatorySupportedCCs"]
47
- self._mandatory_controlled_ccs: list[int] = data["mandatoryControlledCCs"]
48
44
 
49
45
  @property
50
46
  def basic(self) -> DeviceClassItem:
@@ -60,13 +56,3 @@ class DeviceClass:
60
56
  def specific(self) -> DeviceClassItem:
61
57
  """Return specific DeviceClass."""
62
58
  return self._specific
63
-
64
- @property
65
- def mandatory_supported_ccs(self) -> list[int]:
66
- """Return list of mandatory Supported CC id's."""
67
- return self._mandatory_supported_ccs
68
-
69
- @property
70
- def mandatory_controlled_ccs(self) -> list[int]:
71
- """Return list of mandatory Controlled CC id's."""
72
- return self._mandatory_controlled_ccs
@@ -19,12 +19,7 @@ from ...const import (
19
19
  SecurityClass,
20
20
  )
21
21
  from ...event import Event, EventBase
22
- from ...exceptions import (
23
- FailedCommand,
24
- NotFoundError,
25
- UnparseableValue,
26
- UnwriteableValue,
27
- )
22
+ from ...exceptions import NotFoundError, UnparseableValue, UnwriteableValue
28
23
  from ..command_class import CommandClassInfo
29
24
  from ..device_class import DeviceClass
30
25
  from ..device_config import DeviceConfig
@@ -50,7 +45,6 @@ from ..value import (
50
45
  ValueMetadata,
51
46
  ValueNotification,
52
47
  _get_value_id_str_from_dict,
53
- _init_value,
54
48
  )
55
49
  from .data_model import NodeDataType
56
50
  from .event_model import NODE_EVENT_MODEL_MAP
@@ -139,6 +133,12 @@ class Node(EventBase):
139
133
  self.client.driver == other.client.driver and self.node_id == other.node_id
140
134
  )
141
135
 
136
+ def _init_value(self, val: ValueDataType) -> Value | ConfigurationValue:
137
+ """Initialize a Value object from ValueDataType."""
138
+ if val["commandClass"] == CommandClass.CONFIGURATION:
139
+ return ConfigurationValue(self, val)
140
+ return Value(self, val)
141
+
142
142
  @property
143
143
  def node_id(self) -> int:
144
144
  """Return node ID property."""
@@ -429,7 +429,7 @@ class Node(EventBase):
429
429
  if value_id in self.values:
430
430
  self.values[value_id].update(val)
431
431
  else:
432
- self.values[value_id] = _init_value(self, val)
432
+ self.values[value_id] = self._init_value(val)
433
433
  except UnparseableValue:
434
434
  # If we can't parse the value, don't store it
435
435
  pass
@@ -448,8 +448,9 @@ class Node(EventBase):
448
448
  )
449
449
  if last_seen := data.get("lastSeen"):
450
450
  self._last_seen = datetime.fromisoformat(last_seen)
451
- if not self._statistics.last_seen:
451
+ if not self._statistics.last_seen and self.last_seen:
452
452
  self._statistics.last_seen = self.last_seen
453
+ self._statistics.data["lastSeen"] = self.last_seen.isoformat()
453
454
 
454
455
  self._update_values(self.data.pop("values"))
455
456
  self._update_endpoints(self.data.pop("endpoints"))
@@ -593,12 +594,9 @@ class Node(EventBase):
593
594
  data = await self.async_send_command(
594
595
  "get_defined_value_ids", wait_for_result=True
595
596
  )
596
-
597
- if data is None:
598
- # We should never reach this code
599
- raise FailedCommand("Command failed", "failed_command")
597
+ assert data
600
598
  return [
601
- _init_value(self, cast(ValueDataType, value_id))
599
+ self._init_value(cast(ValueDataType, value_id))
602
600
  for value_id in data["valueIds"]
603
601
  ]
604
602
 
@@ -1061,7 +1059,7 @@ class Node(EventBase):
1061
1059
  value_id = _get_value_id_str_from_dict(self, evt_val_data)
1062
1060
  value = self.values.get(value_id)
1063
1061
  if value is None:
1064
- value = _init_value(self, evt_val_data)
1062
+ value = self._init_value(evt_val_data)
1065
1063
  self.values[value.value_id] = event.data["value"] = value
1066
1064
  else:
1067
1065
  value.receive_event(event)
@@ -8,7 +8,6 @@ from typing import TYPE_CHECKING, Any, TypedDict
8
8
 
9
9
  from ..const import (
10
10
  VALUE_UNKNOWN,
11
- CommandClass,
12
11
  CommandStatus,
13
12
  ConfigurationValueType,
14
13
  SetValueStatus,
@@ -75,13 +74,6 @@ class ValueDataType(TypedDict, total=False):
75
74
  ccVersion: int # required
76
75
 
77
76
 
78
- def _init_value(node: Node, val: ValueDataType) -> Value | ConfigurationValue:
79
- """Initialize a Value object from ValueDataType."""
80
- if val["commandClass"] == CommandClass.CONFIGURATION:
81
- return ConfigurationValue(node, val)
82
- return Value(node, val)
83
-
84
-
85
77
  def _get_value_id_str_from_dict(node: Node, val: ValueDataType) -> str:
86
78
  """Return string ID of value from ValueDataType dict."""
87
79
  return get_value_id_str(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zwave-js-server-python
3
- Version: 0.56.0
3
+ Version: 0.57.0
4
4
  Summary: Python wrapper for zwave-js-server
5
5
  Author-email: Home Assistant Team <hello@home-assistant.io>
6
6
  License: Apache License
@@ -212,9 +212,9 @@ Classifier: Development Status :: 4 - Beta
212
212
  Classifier: Intended Audience :: Developers
213
213
  Classifier: Natural Language :: English
214
214
  Classifier: Programming Language :: Python :: 3
215
- Classifier: Programming Language :: Python :: 3.11
215
+ Classifier: Programming Language :: Python :: 3.12
216
216
  Classifier: Topic :: Home Automation
217
- Requires-Python: >=3.11
217
+ Requires-Python: >=3.12
218
218
  Description-Content-Type: text/markdown
219
219
  License-File: LICENSE
220
220
  Requires-Dist: aiohttp >3
@@ -7,7 +7,7 @@ zwave_js_server/exceptions.py,sha256=8SY6FA8NiTEQgtauLR83F7m69gBGQviJ6O2obirH2po
7
7
  zwave_js_server/firmware.py,sha256=KXB_-MgBDlNg289bPibUeWtF4l8WtEq9jmiFFMYg1KM,2381
8
8
  zwave_js_server/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  zwave_js_server/version.py,sha256=PUwxOVcUMk5pOguQP9zAjiPjs1Nnmiwj3fcA4HJLiBg,401
10
- zwave_js_server/const/__init__.py,sha256=I43CH0L33AQUFVVDh48FDO6sIt-aZBtRALQHgauPBRE,13808
10
+ zwave_js_server/const/__init__.py,sha256=LWxaeMHr6vT5AbQ6I3yjz19eqsxoOlGdHkytoaTqYsQ,13808
11
11
  zwave_js_server/const/command_class/__init__.py,sha256=WilOppnr9CXahDjEEkAXyh_j7iCq_qZ1GtBkjWLoQUg,37
12
12
  zwave_js_server/const/command_class/barrier_operator.py,sha256=IJ195hGKEi1FLLqKWMtC2ZhY9Jt5PACr7GYTyVPjkKM,820
13
13
  zwave_js_server/const/command_class/basic.py,sha256=cs0k7p5qxrwpR8-NvXQLtnfEsC6IlBAYiW79DaM_6Eg,96
@@ -17,7 +17,7 @@ zwave_js_server/const/command_class/energy_production.py,sha256=Ah9Zzb3EHFrN28v-
17
17
  zwave_js_server/const/command_class/entry_control.py,sha256=WetdiEx0K4QaasYS1wEYndxz5lFqpvVcLR5Slz03T1s,972
18
18
  zwave_js_server/const/command_class/humidity_control.py,sha256=AtrhAaDst7LC7c-PZeLmdgoo5D6996PfwuJrdni-yr8,1894
19
19
  zwave_js_server/const/command_class/lock.py,sha256=HTLnjVYrLnGbWhrvETeaCbHXKemklDfzOHsD4D0uHh4,6629
20
- zwave_js_server/const/command_class/meter.py,sha256=l_ys_r5lOGGxW-XfdgSobS3QxPsaVp3hV8Jm9dl3a_A,3998
20
+ zwave_js_server/const/command_class/meter.py,sha256=XAm68dz48_mSW2Uahb06EGC3vpbrdhvhyni3UZLd44Q,4023
21
21
  zwave_js_server/const/command_class/multilevel_sensor.py,sha256=Js5ZIORRkGAEfJa491m91Jf8L0Owxg9ibUBQTSaUSP4,37067
22
22
  zwave_js_server/const/command_class/multilevel_switch.py,sha256=yBDE9O9Ad1eMK_rgqs7l-DPJxnB-fi9CGclgpFc-QRk,576
23
23
  zwave_js_server/const/command_class/notification.py,sha256=psLLSYNsBaKq3lEOTXdChvLrNPwZK2CD3BCGWmD1QGs,37899
@@ -31,7 +31,7 @@ zwave_js_server/const/command_class/window_covering.py,sha256=o2_CBQ5DSbDNmJQxrc
31
31
  zwave_js_server/model/__init__.py,sha256=XfyKH8lxZ3CB7CbRkOr5sR-eV0GrklZiBtNPmlnCJ_8,123
32
32
  zwave_js_server/model/association.py,sha256=nRFEC2ysQlIq3Xezh9Hqx9BTdL0b5PNDN7XguIKhhvU,527
33
33
  zwave_js_server/model/command_class.py,sha256=_YimyLtb3aFHdhbYURNZZQlAf-lc3CC8HW8Vbk-Vrqc,1263
34
- zwave_js_server/model/device_class.py,sha256=owVKlFjQ32O3qrOiL6QruVKLfzMjS9Id_s-oGInf4eY,1964
34
+ zwave_js_server/model/device_class.py,sha256=8cApdA1FgMWJeQ-yhlVpCzrfOwNykg7lOCiP16nu0uE,1382
35
35
  zwave_js_server/model/device_config.py,sha256=PV13U1T0zlBJ4CvoLziFW2SUJHHumYiez-n2qOapaQw,6423
36
36
  zwave_js_server/model/driver.py,sha256=w4PXh90OYSI7hEHA7VjIMYrY-NS-wV32H5u2ykrdTLI,6518
37
37
  zwave_js_server/model/duration.py,sha256=OW2OqReexL6GXxxLs__i5Vs3JCVoODgLpwPHU48yynU,1153
@@ -41,16 +41,16 @@ zwave_js_server/model/log_message.py,sha256=SNicnss7LUZd6woMecNQ0ZKwghC9OmxNdA1v
41
41
  zwave_js_server/model/notification.py,sha256=-M9MZ1RUWmUCHuIU_So6h5sYhMILKxntGx3zBkKaqeo,6165
42
42
  zwave_js_server/model/statistics.py,sha256=in7S8oxWlG38tCEz1k3lxLjEsfY5yfsnD0bolcEeuHg,3233
43
43
  zwave_js_server/model/utils.py,sha256=VMoJQ99QRkpJleJhXR4eojbgObdZZeEfse5gonmK7Ic,1157
44
- zwave_js_server/model/value.py,sha256=7vr5CYV2TC5I593ww1CBJvM1GzpTFM31qfkYZto6_K0,13552
44
+ zwave_js_server/model/value.py,sha256=Ku_VnX79WL82SD6Up01qQUNRldnCvi37HeEuTrTdBPU,13266
45
45
  zwave_js_server/model/version.py,sha256=EnyL6O8r2gSv7qLIuZ-sWnybG5JnJWw-IEE5UtIUjiM,1272
46
46
  zwave_js_server/model/controller/__init__.py,sha256=HkVk2on8qljAvYw7jcSHv2p1lIs0UDD1QDu20J4SRdo,36544
47
47
  zwave_js_server/model/controller/data_model.py,sha256=5e6M0t7RkSJytovmDz1tULMFFoCQ1TsGHe56scrZRqI,851
48
48
  zwave_js_server/model/controller/event_model.py,sha256=-pqe316I7MVdIm8btovsw5ZXZbillDyH7AnGoYtvZWg,6207
49
49
  zwave_js_server/model/controller/firmware.py,sha256=GnctTeLitmUVf3wfJgZsDBAlQP4eDU6ytohXqigjGEg,2907
50
- zwave_js_server/model/controller/inclusion_and_provisioning.py,sha256=Vq8uDujGkt_oaPKV4F8RdcM1eCCJKBSvbYlnI0qHYK8,7491
50
+ zwave_js_server/model/controller/inclusion_and_provisioning.py,sha256=PAO5HQE_yyTMxoVN3Woth1qC_oL6EzJNJ7NEvMtpBEA,7667
51
51
  zwave_js_server/model/controller/rebuild_routes.py,sha256=ElAZdSLiDaQLbGgfJQMnuilTpsSbCz3qag3lFBt2JoM,1073
52
52
  zwave_js_server/model/controller/statistics.py,sha256=iU2wiRvWvHzYGwydOqs8Y7CBdKA3DgL6tI1NW1zBTfU,4672
53
- zwave_js_server/model/node/__init__.py,sha256=N3fBQImgnNzCDVsmc3NnTApZV8lirusdn-SNoJcAHNY,40911
53
+ zwave_js_server/model/node/__init__.py,sha256=e60y2LPetcUmIJDjQYegp7IsfKbe_jAUYOHpwRqK8mI,41110
54
54
  zwave_js_server/model/node/data_model.py,sha256=sQp0Mlp0SBkPv170cD0MjIX4BAMmrr4HtTZaKbIA0kQ,1845
55
55
  zwave_js_server/model/node/event_model.py,sha256=Xaw_P3IlefSA-sFCJSJE4qmYeptQGSuYHNlnYPJlImg,6281
56
56
  zwave_js_server/model/node/firmware.py,sha256=rPWNYSxHpxviZ2272r_FY8WdAv-qMurXNOsFlAyZDuA,10106
@@ -65,9 +65,9 @@ zwave_js_server/util/command_class/__init__.py,sha256=sRxti47ekLTzfk8B609CMQumIb
65
65
  zwave_js_server/util/command_class/energy_production.py,sha256=K1VmGDlqXmKDfQRpTu5o99sjnDShBMV_crEb49o-O_4,1489
66
66
  zwave_js_server/util/command_class/meter.py,sha256=tJ7rbwWUZbJCS7xEJWS_KnqUUGR8RN0f2S8iLkufae0,1258
67
67
  zwave_js_server/util/command_class/multilevel_sensor.py,sha256=wG4GQ0kjrP6d3x5DpEkUHrZd8-0LbvXoYdIxZAf6bso,1427
68
- zwave_js_server_python-0.56.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
69
- zwave_js_server_python-0.56.0.dist-info/METADATA,sha256=HBXTuqRHL0PW8e7p55c4cuZeCdGDZkBgv2U_EWOxdxc,14767
70
- zwave_js_server_python-0.56.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
71
- zwave_js_server_python-0.56.0.dist-info/entry_points.txt,sha256=lvzma7Rd_3FW_k-_xGuTfpvcvA2MR_22DOz5f1t7-xg,73
72
- zwave_js_server_python-0.56.0.dist-info/top_level.txt,sha256=-hwsl-i4Av5Op_yfOHC_OP56KPmzp_iVEkeohRIN5Ng,16
73
- zwave_js_server_python-0.56.0.dist-info/RECORD,,
68
+ zwave_js_server_python-0.57.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
69
+ zwave_js_server_python-0.57.0.dist-info/METADATA,sha256=sv9yB4ZaMDT5ESayBhmbfQvCRb7zbuBjZRknheryO6E,14767
70
+ zwave_js_server_python-0.57.0.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
71
+ zwave_js_server_python-0.57.0.dist-info/entry_points.txt,sha256=lvzma7Rd_3FW_k-_xGuTfpvcvA2MR_22DOz5f1t7-xg,73
72
+ zwave_js_server_python-0.57.0.dist-info/top_level.txt,sha256=-hwsl-i4Av5Op_yfOHC_OP56KPmzp_iVEkeohRIN5Ng,16
73
+ zwave_js_server_python-0.57.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (70.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5