zwave-js-server-python 0.40.0__py3-none-any.whl → 0.41.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.
- zwave_js_server/const/__init__.py +20 -2
- zwave_js_server/model/controller/__init__.py +23 -16
- zwave_js_server/model/controller/data_model.py +4 -4
- zwave_js_server/model/controller/event_model.py +2 -2
- zwave_js_server/model/node/__init__.py +8 -0
- zwave_js_server/model/node/data_model.py +7 -0
- {zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/METADATA +1 -1
- {zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/RECORD +12 -12
- {zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/LICENSE +0 -0
- {zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/WHEEL +0 -0
- {zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/entry_points.txt +0 -0
- {zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/top_level.txt +0 -0
|
@@ -3,9 +3,9 @@ import sys
|
|
|
3
3
|
from enum import Enum, IntEnum
|
|
4
4
|
|
|
5
5
|
# minimal server schema version we can handle
|
|
6
|
-
MIN_SERVER_SCHEMA_VERSION =
|
|
6
|
+
MIN_SERVER_SCHEMA_VERSION = 22
|
|
7
7
|
# max server schema version we can handle (and our code is compatible with)
|
|
8
|
-
MAX_SERVER_SCHEMA_VERSION =
|
|
8
|
+
MAX_SERVER_SCHEMA_VERSION = 22
|
|
9
9
|
|
|
10
10
|
TYPING_EXTENSION_FOR_TYPEDDICT_REQUIRED = sys.version_info < (3, 9, 2)
|
|
11
11
|
|
|
@@ -204,6 +204,24 @@ class ConfigurationValueType(str, Enum):
|
|
|
204
204
|
UNDEFINED = "undefined"
|
|
205
205
|
|
|
206
206
|
|
|
207
|
+
class NodeType(IntEnum):
|
|
208
|
+
"""Enum with all Node types."""
|
|
209
|
+
|
|
210
|
+
# https://github.com/zwave-js/node-zwave-js/blob/master/packages/core/src/capabilities/NodeInfo.ts#L151-L156
|
|
211
|
+
CONTROLLER = 0
|
|
212
|
+
END_NODE = 1
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
# Exclusion enums
|
|
216
|
+
class ExclusionStrategy(IntEnum):
|
|
217
|
+
"""Enum with all exclusion strategies."""
|
|
218
|
+
|
|
219
|
+
# https://github.com/zwave-js/node-zwave-js/blob/master/packages/zwave-js/src/lib/controller/Inclusion.ts#L49-L56
|
|
220
|
+
EXCLUDE_ONLY = 0
|
|
221
|
+
DISABLE_PROVISIONING_ENTRY = 1
|
|
222
|
+
UNPROVISION = 2
|
|
223
|
+
|
|
224
|
+
|
|
207
225
|
# Inclusion enums
|
|
208
226
|
class InclusionStrategy(IntEnum):
|
|
209
227
|
"""Enum for all known inclusion strategies."""
|
|
@@ -6,8 +6,10 @@ from zwave_js_server.model.firmware import FirmwareUpdateFileInfo, FirmwareUpdat
|
|
|
6
6
|
|
|
7
7
|
from ...const import (
|
|
8
8
|
MINIMUM_QR_STRING_LENGTH,
|
|
9
|
+
ExclusionStrategy,
|
|
9
10
|
InclusionState,
|
|
10
11
|
InclusionStrategy,
|
|
12
|
+
NodeType,
|
|
11
13
|
QRCodeVersion,
|
|
12
14
|
RFRegion,
|
|
13
15
|
ZwaveFeature,
|
|
@@ -87,9 +89,9 @@ class Controller(EventBase):
|
|
|
87
89
|
return self.data.get("ownNodeId")
|
|
88
90
|
|
|
89
91
|
@property
|
|
90
|
-
def
|
|
91
|
-
"""Return
|
|
92
|
-
return self.data.get("
|
|
92
|
+
def is_primary(self) -> Optional[bool]:
|
|
93
|
+
"""Return is_primary."""
|
|
94
|
+
return self.data.get("isPrimary")
|
|
93
95
|
|
|
94
96
|
@property
|
|
95
97
|
def is_using_home_id_from_other_network(self) -> Optional[bool]:
|
|
@@ -107,14 +109,16 @@ class Controller(EventBase):
|
|
|
107
109
|
return self.data.get("wasRealPrimary")
|
|
108
110
|
|
|
109
111
|
@property
|
|
110
|
-
def
|
|
111
|
-
"""Return
|
|
112
|
-
return self.data.get("
|
|
112
|
+
def is_suc(self) -> Optional[bool]:
|
|
113
|
+
"""Return is_suc."""
|
|
114
|
+
return self.data.get("isSUC")
|
|
113
115
|
|
|
114
116
|
@property
|
|
115
|
-
def
|
|
116
|
-
"""Return
|
|
117
|
-
|
|
117
|
+
def node_type(self) -> Optional[NodeType]:
|
|
118
|
+
"""Return node_type."""
|
|
119
|
+
if (node_type := self.data.get("nodeType")) is not None:
|
|
120
|
+
return NodeType(node_type)
|
|
121
|
+
return None
|
|
118
122
|
|
|
119
123
|
@property
|
|
120
124
|
def firmware_version(self) -> Optional[str]:
|
|
@@ -312,13 +316,15 @@ class Controller(EventBase):
|
|
|
312
316
|
return cast(bool, data["success"])
|
|
313
317
|
|
|
314
318
|
async def async_begin_exclusion(
|
|
315
|
-
self,
|
|
319
|
+
self, strategy: Optional[ExclusionStrategy] = None
|
|
316
320
|
) -> bool:
|
|
317
321
|
"""Send beginExclusion command to Controller."""
|
|
318
|
-
payload: Dict[str, Union[str,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
+
payload: Dict[str, Union[str, ExclusionStrategy]] = {
|
|
323
|
+
"command": "controller.begin_exclusion"
|
|
324
|
+
}
|
|
325
|
+
if strategy is not None:
|
|
326
|
+
payload["strategy"] = strategy
|
|
327
|
+
data = await self.client.async_send_command(payload, require_schema=22)
|
|
322
328
|
return cast(bool, data["success"])
|
|
323
329
|
|
|
324
330
|
async def async_stop_exclusion(self) -> bool:
|
|
@@ -707,15 +713,16 @@ class Controller(EventBase):
|
|
|
707
713
|
return cast(bool, data["progress"])
|
|
708
714
|
|
|
709
715
|
async def async_get_available_firmware_updates(
|
|
710
|
-
self, node: Node
|
|
716
|
+
self, node: Node, api_key: str
|
|
711
717
|
) -> List[FirmwareUpdateInfo]:
|
|
712
718
|
"""Send getAvailableFirmwareUpdates command to Controller."""
|
|
713
719
|
data = await self.client.async_send_command(
|
|
714
720
|
{
|
|
715
721
|
"command": "controller.get_available_firmware_updates",
|
|
716
722
|
"nodeId": node.node_id,
|
|
723
|
+
"apiKey": api_key,
|
|
717
724
|
},
|
|
718
|
-
require_schema=
|
|
725
|
+
require_schema=22,
|
|
719
726
|
)
|
|
720
727
|
assert data
|
|
721
728
|
return [FirmwareUpdateInfo.from_dict(update) for update in data["updates"]]
|
|
@@ -17,12 +17,12 @@ class ControllerDataType(TypedDict, total=False):
|
|
|
17
17
|
type: int
|
|
18
18
|
homeId: int
|
|
19
19
|
ownNodeId: int
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
isPrimary: bool
|
|
21
|
+
isSUC: bool
|
|
22
|
+
nodeType: int
|
|
23
|
+
isUsingHomeIdFromOtherNetwork: bool # TODO: The following items are missing in the docs.
|
|
22
24
|
isSISPresent: bool
|
|
23
25
|
wasRealPrimary: bool
|
|
24
|
-
isStaticUpdateController: bool
|
|
25
|
-
isSlave: bool
|
|
26
26
|
firmwareVersion: str
|
|
27
27
|
manufacturerId: int
|
|
28
28
|
productType: int
|
|
@@ -3,7 +3,7 @@ from typing import Dict, Literal, Type
|
|
|
3
3
|
|
|
4
4
|
from ...const import TYPING_EXTENSION_FOR_TYPEDDICT_REQUIRED
|
|
5
5
|
from ...event import BaseEventModel
|
|
6
|
-
from ..node.data_model import NodeDataType
|
|
6
|
+
from ..node.data_model import FoundNodeDataType, NodeDataType
|
|
7
7
|
from .inclusion_and_provisioning import InclusionGrantDataType
|
|
8
8
|
from .statistics import ControllerStatisticsDataType
|
|
9
9
|
|
|
@@ -101,7 +101,7 @@ class NodeFoundEventModel(BaseControllerEventModel):
|
|
|
101
101
|
"""Model for `node found` event data."""
|
|
102
102
|
|
|
103
103
|
event: Literal["node found"]
|
|
104
|
-
node:
|
|
104
|
+
node: FoundNodeDataType
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
class NodeRemovedEventModel(BaseControllerEventModel):
|
|
@@ -706,6 +706,14 @@ class Node(EventBase):
|
|
|
706
706
|
)
|
|
707
707
|
self.data["keepAwake"] = keep_awake
|
|
708
708
|
|
|
709
|
+
async def async_interview(self) -> None:
|
|
710
|
+
"""Interview node."""
|
|
711
|
+
await self.async_send_command(
|
|
712
|
+
"interview",
|
|
713
|
+
wait_for_result=False,
|
|
714
|
+
require_schema=22,
|
|
715
|
+
)
|
|
716
|
+
|
|
709
717
|
def handle_test_powerlevel_progress(self, event: Event) -> None:
|
|
710
718
|
"""Process a test power level progress event."""
|
|
711
719
|
event.data["test_power_level_progress"] = TestPowerLevelProgress(
|
|
@@ -14,6 +14,13 @@ else:
|
|
|
14
14
|
from typing import TypedDict
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
class FoundNodeDataType(TypedDict, total=False):
|
|
18
|
+
"""Represent a found node data dict type."""
|
|
19
|
+
|
|
20
|
+
nodeId: int
|
|
21
|
+
deviceClass: DeviceClassDataType
|
|
22
|
+
|
|
23
|
+
|
|
17
24
|
class NodeDataType(TypedDict, total=False):
|
|
18
25
|
"""Represent a node data dict type."""
|
|
19
26
|
|
|
@@ -7,7 +7,7 @@ zwave_js_server/exceptions.py,sha256=guJlsUNQMGl-P8dVydup686_xzpbzCkd1870RbqZ6PE
|
|
|
7
7
|
zwave_js_server/firmware.py,sha256=Wo_o2e_jHeuX0mDTFUEJ-l_m3QOkXIwVFsLxBLYAC8E,1139
|
|
8
8
|
zwave_js_server/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
zwave_js_server/version.py,sha256=RDFP2kSU3cCVIQbgMWggdeDnvhtVsZzzZg9pOjH7CC8,364
|
|
10
|
-
zwave_js_server/const/__init__.py,sha256=
|
|
10
|
+
zwave_js_server/const/__init__.py,sha256=FLs78YmjFDzHQgUsaMIf1OaTB2aSd_FyA5wmKV4S1HE,9014
|
|
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=NBhTp5T-6T31glpIKrEOLgbKTndkB5gqdQmCJlXFFUA,783
|
|
13
13
|
zwave_js_server/const/command_class/color_switch.py,sha256=9jIDdmz8gJ5d1RdINHiK7Yh0NXg1I0U1xVzkrQJICk8,918
|
|
@@ -38,13 +38,13 @@ zwave_js_server/model/statistics.py,sha256=uG87o-iNGKHxJc4Kfr2ZJ0VY7NjCbdxwgWOqu
|
|
|
38
38
|
zwave_js_server/model/utils.py,sha256=fLs1pOKG53yWQggBWUKvPgzlT0JkK3biLzRkhPBNArI,814
|
|
39
39
|
zwave_js_server/model/value.py,sha256=dV6a3QMga1T-KfCQsle6lauK9rxSzd6rhF-eldRaJOU,8754
|
|
40
40
|
zwave_js_server/model/version.py,sha256=W1H-UbhKdgMW5KdnY9MUfRFibfMZSOD3nljXOv1ZVVM,1398
|
|
41
|
-
zwave_js_server/model/controller/__init__.py,sha256=
|
|
42
|
-
zwave_js_server/model/controller/data_model.py,sha256=
|
|
43
|
-
zwave_js_server/model/controller/event_model.py,sha256=
|
|
41
|
+
zwave_js_server/model/controller/__init__.py,sha256=cpf9iVt2deMGTXZ7pwkX9gERVgaQEjOVxl8mZU4lUBc,31419
|
|
42
|
+
zwave_js_server/model/controller/data_model.py,sha256=XepG9ICR3ooRwQuMOZPL5QG9mHCcMfH5-sa_GWISAdg,949
|
|
43
|
+
zwave_js_server/model/controller/event_model.py,sha256=pDk0t_czfnpL107Z9OiiOyO3ZpQ70KgPXR9_5YX2V3c,5161
|
|
44
44
|
zwave_js_server/model/controller/inclusion_and_provisioning.py,sha256=01YUq4YBhQe3gmJAIsN6ctMM3pcLEaGMSyIySBI9v2c,7497
|
|
45
45
|
zwave_js_server/model/controller/statistics.py,sha256=7aeFjKq_-TvcHBWc-a4xQP6wvO3GoGjr9P-m8uyOco8,4031
|
|
46
|
-
zwave_js_server/model/node/__init__.py,sha256=
|
|
47
|
-
zwave_js_server/model/node/data_model.py,sha256=
|
|
46
|
+
zwave_js_server/model/node/__init__.py,sha256=b9YxVXtosDDHSwBSqVZplGnIww9IyBWWK8MD17UHiPA,31294
|
|
47
|
+
zwave_js_server/model/node/data_model.py,sha256=x7Nx4-l0K7fp4uJOXNhv2xDPzrhYcEFMbsbtsss5l6M,1884
|
|
48
48
|
zwave_js_server/model/node/event_model.py,sha256=kY-HxdRpJUGiQaM4T7DInQBJ4rf4pw1JY-nImsF-1kY,6055
|
|
49
49
|
zwave_js_server/model/node/health_check.py,sha256=EAOMBkMKd5q--fhax2GvJhWdhuuv5dX_-2Hf_mczODs,6054
|
|
50
50
|
zwave_js_server/model/node/statistics.py,sha256=SgAdnXnvC-Hs2GdBvENz1mkbtnXOUf5E0s2OU0iUARE,3634
|
|
@@ -56,9 +56,9 @@ zwave_js_server/util/node.py,sha256=KUg-Z-7hdDLGKKCYLktc4oOgiPbDT7ZUYqUH_IPLwO4,
|
|
|
56
56
|
zwave_js_server/util/command_class/__init__.py,sha256=sRxti47ekLTzfk8B609CMQumIbcD6mon2ZS0zwh9omY,59
|
|
57
57
|
zwave_js_server/util/command_class/meter.py,sha256=Qkif1ul4KpV_k6Dc7yNXlSjlJLLTH8mCitgQk9J9W0A,1277
|
|
58
58
|
zwave_js_server/util/command_class/multilevel_sensor.py,sha256=p92YLNRze5z3UWhfIDJO95F-j5tqx1PKUG9oamo9Dng,1446
|
|
59
|
-
zwave_js_server_python-0.
|
|
60
|
-
zwave_js_server_python-0.
|
|
61
|
-
zwave_js_server_python-0.
|
|
62
|
-
zwave_js_server_python-0.
|
|
63
|
-
zwave_js_server_python-0.
|
|
64
|
-
zwave_js_server_python-0.
|
|
59
|
+
zwave_js_server_python-0.41.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
60
|
+
zwave_js_server_python-0.41.0.dist-info/METADATA,sha256=UWYOfP1-q--FhdMEJHWKivdCuzEImzUhalh_cOJGPl4,1712
|
|
61
|
+
zwave_js_server_python-0.41.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
62
|
+
zwave_js_server_python-0.41.0.dist-info/entry_points.txt,sha256=_8Swg1yhKiBElo6k1fxIEd6E8uPz8PDxQpwQoZ29FZE,74
|
|
63
|
+
zwave_js_server_python-0.41.0.dist-info/top_level.txt,sha256=-hwsl-i4Av5Op_yfOHC_OP56KPmzp_iVEkeohRIN5Ng,16
|
|
64
|
+
zwave_js_server_python-0.41.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
{zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{zwave_js_server_python-0.40.0.dist-info → zwave_js_server_python-0.41.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|