zwave-js-server-python 0.32.0__tar.gz → 0.33.0__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.
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/PKG-INFO +1 -1
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/setup.py +1 -1
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/test/test_main.py +1 -1
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/__init__.py +13 -2
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/controller.py +54 -2
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/utils.py +8 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server_python.egg-info/PKG-INFO +1 -1
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/LICENSE +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/README.md +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/setup.cfg +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/test/test_client.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/test/test_dump.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/test/test_event.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/test/test_firmware.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/test/test_version.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/__init__.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/__main__.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/client.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/__init__.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/barrier_operator.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/color_switch.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/entry_control.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/lock.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/meter.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/multilevel_sensor.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/multilevel_switch.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/notification.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/protection.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/sound_switch.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/thermostat.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/command_class/wake_up.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/dump.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/event.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/exceptions.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/firmware.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/__init__.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/association.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/command_class.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/device_class.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/device_config.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/driver.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/endpoint.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/firmware.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/log_config.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/log_message.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/node.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/notification.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/value.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/version.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/__init__.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/command_class/__init__.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/command_class/meter.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/command_class/multilevel_sensor.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/helpers.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/lock.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/multicast.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/node.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/version.py +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server_python.egg-info/SOURCES.txt +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server_python.egg-info/dependency_links.txt +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server_python.egg-info/entry_points.txt +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server_python.egg-info/not-zip-safe +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server_python.egg-info/requires.txt +0 -0
- {zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server_python.egg-info/top_level.txt +0 -0
|
@@ -64,7 +64,7 @@ def test_dump_state(
|
|
|
64
64
|
assert captured.out == (
|
|
65
65
|
"{'type': 'version', 'driverVersion': 'test_driver_version', "
|
|
66
66
|
"'serverVersion': 'test_server_version', 'homeId': 'test_home_id', "
|
|
67
|
-
"'minSchemaVersion': 0, 'maxSchemaVersion':
|
|
67
|
+
"'minSchemaVersion': 0, 'maxSchemaVersion': 12}\n"
|
|
68
68
|
"{'type': 'result', 'success': True, 'result': {}, 'messageId': 'api-schema-id'}\n"
|
|
69
69
|
"test_result\n"
|
|
70
70
|
)
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/const/__init__.py
RENAMED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
from enum import Enum, IntEnum
|
|
3
3
|
|
|
4
4
|
# minimal server schema version we can handle
|
|
5
|
-
MIN_SERVER_SCHEMA_VERSION =
|
|
5
|
+
MIN_SERVER_SCHEMA_VERSION = 12
|
|
6
6
|
# max server schema version we can handle (and our code is compatible with)
|
|
7
|
-
MAX_SERVER_SCHEMA_VERSION =
|
|
7
|
+
MAX_SERVER_SCHEMA_VERSION = 12
|
|
8
8
|
|
|
9
9
|
VALUE_UNKNOWN = "unknown"
|
|
10
10
|
|
|
@@ -237,3 +237,14 @@ class Protocols(IntEnum):
|
|
|
237
237
|
# https://github.com/zwave-js/node-zwave-js/blob/master/packages/core/src/capabilities/Protocols.ts#L1-L4
|
|
238
238
|
ZWAVE = 0
|
|
239
239
|
ZWAVE_LONG_RANGE = 1
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
# https://github.com/zwave-js/node-zwave-js/blob/master/packages/core/src/security/QR.ts#L41
|
|
243
|
+
MINIMUM_QR_STRING_LENGTH = 52
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
class ZwaveFeature(IntEnum):
|
|
247
|
+
"""Enum for all known Zwave features."""
|
|
248
|
+
|
|
249
|
+
# https://github.com/zwave-js/node-zwave-js/blob/master/packages/zwave-js/src/lib/controller/Features.ts#L4
|
|
250
|
+
SMART_START = 0
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/controller.py
RENAMED
|
@@ -12,7 +12,14 @@ from typing import (
|
|
|
12
12
|
cast,
|
|
13
13
|
)
|
|
14
14
|
|
|
15
|
-
from ..const import
|
|
15
|
+
from ..const import (
|
|
16
|
+
MINIMUM_QR_STRING_LENGTH,
|
|
17
|
+
InclusionStrategy,
|
|
18
|
+
Protocols,
|
|
19
|
+
QRCodeVersion,
|
|
20
|
+
SecurityClass,
|
|
21
|
+
ZwaveFeature,
|
|
22
|
+
)
|
|
16
23
|
from ..event import Event, EventBase
|
|
17
24
|
from .association import Association, AssociationGroup
|
|
18
25
|
from .node import Node
|
|
@@ -442,9 +449,26 @@ class Controller(EventBase):
|
|
|
442
449
|
require_schema = 11
|
|
443
450
|
# String is assumed to be the QR code string so we can pass as is
|
|
444
451
|
if isinstance(provisioning, str):
|
|
452
|
+
if len(
|
|
453
|
+
provisioning
|
|
454
|
+
) < MINIMUM_QR_STRING_LENGTH or not provisioning.startswith("90"):
|
|
455
|
+
raise ValueError(
|
|
456
|
+
f"QR code string must be at least {MINIMUM_QR_STRING_LENGTH} characters "
|
|
457
|
+
"long and start with `90`"
|
|
458
|
+
)
|
|
445
459
|
options["provisioning"] = provisioning
|
|
460
|
+
# If we get a Smart Start QR code, we provision the node and return because
|
|
461
|
+
# inclusion is over
|
|
462
|
+
elif (
|
|
463
|
+
isinstance(provisioning, QRProvisioningInformation)
|
|
464
|
+
and provisioning.version == QRCodeVersion.SMART_START
|
|
465
|
+
):
|
|
466
|
+
raise ValueError(
|
|
467
|
+
"Smart Start QR codes can't use the normal inclusion process. Use the "
|
|
468
|
+
"provision_smart_start_node command to provision this device."
|
|
469
|
+
)
|
|
446
470
|
# Otherwise we assume the data is ProvisioningEntry or
|
|
447
|
-
# QRProvisioningInformation
|
|
471
|
+
# QRProvisioningInformation that is not a Smart Start QR code
|
|
448
472
|
else:
|
|
449
473
|
options["provisioning"] = provisioning.to_dict()
|
|
450
474
|
|
|
@@ -462,6 +486,13 @@ class Controller(EventBase):
|
|
|
462
486
|
provisioning_info: Union[ProvisioningEntry, QRProvisioningInformation, str],
|
|
463
487
|
) -> None:
|
|
464
488
|
"""Send provisionSmartStartNode command to Controller."""
|
|
489
|
+
if (
|
|
490
|
+
isinstance(provisioning_info, QRProvisioningInformation)
|
|
491
|
+
and provisioning_info.version == QRCodeVersion.S2
|
|
492
|
+
):
|
|
493
|
+
raise ValueError(
|
|
494
|
+
"An S2 QR Code can't be used to pre-provision a Smart Start node"
|
|
495
|
+
)
|
|
465
496
|
await self.client.async_send_command(
|
|
466
497
|
{
|
|
467
498
|
"command": "controller.provision_smart_start_node",
|
|
@@ -573,11 +604,19 @@ class Controller(EventBase):
|
|
|
573
604
|
require_schema = 11
|
|
574
605
|
# String is assumed to be the QR code string so we can pass as is
|
|
575
606
|
if isinstance(provisioning, str):
|
|
607
|
+
if len(
|
|
608
|
+
provisioning
|
|
609
|
+
) < MINIMUM_QR_STRING_LENGTH or not provisioning.startswith("90"):
|
|
610
|
+
raise ValueError(
|
|
611
|
+
f"QR code string must be at least {MINIMUM_QR_STRING_LENGTH} characters "
|
|
612
|
+
"long and start with `90`"
|
|
613
|
+
)
|
|
576
614
|
options["provisioning"] = provisioning
|
|
577
615
|
# Otherwise we assume the data is ProvisioningEntry or
|
|
578
616
|
# QRProvisioningInformation
|
|
579
617
|
else:
|
|
580
618
|
options["provisioning"] = provisioning.to_dict()
|
|
619
|
+
|
|
581
620
|
data = await self.client.async_send_command(
|
|
582
621
|
{
|
|
583
622
|
"command": "controller.replace_failed_node",
|
|
@@ -751,6 +790,19 @@ class Controller(EventBase):
|
|
|
751
790
|
}
|
|
752
791
|
)
|
|
753
792
|
|
|
793
|
+
async def async_supports_feature(self, feature: ZwaveFeature) -> Optional[bool]:
|
|
794
|
+
"""
|
|
795
|
+
Send supportsFeature command to Controller.
|
|
796
|
+
|
|
797
|
+
When None is returned it means the driver does not yet know whether the
|
|
798
|
+
controller supports the input feature.
|
|
799
|
+
"""
|
|
800
|
+
data = await self.client.async_send_command(
|
|
801
|
+
{"command": "controller.supports_feature", "feature": feature.value},
|
|
802
|
+
require_schema=12,
|
|
803
|
+
)
|
|
804
|
+
return cast(Optional[bool], data.get("supported"))
|
|
805
|
+
|
|
754
806
|
def receive_event(self, event: Event) -> None:
|
|
755
807
|
"""Receive an event."""
|
|
756
808
|
if event.data["source"] == "node":
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/utils.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Model for utils commands."""
|
|
2
|
+
from zwave_js_server.const import MINIMUM_QR_STRING_LENGTH
|
|
2
3
|
from ..client import Client
|
|
3
4
|
from .controller import QRProvisioningInformation
|
|
4
5
|
|
|
@@ -7,6 +8,13 @@ async def async_parse_qr_code_string(
|
|
|
7
8
|
client: Client, qr_code_string: str
|
|
8
9
|
) -> QRProvisioningInformation:
|
|
9
10
|
"""Parse a QR code string into a QRProvisioningInformation object."""
|
|
11
|
+
if len(qr_code_string) < MINIMUM_QR_STRING_LENGTH or not qr_code_string.startswith(
|
|
12
|
+
"90"
|
|
13
|
+
):
|
|
14
|
+
raise ValueError(
|
|
15
|
+
f"QR code string must be at least {MINIMUM_QR_STRING_LENGTH} characters "
|
|
16
|
+
"long and start with `90`"
|
|
17
|
+
)
|
|
10
18
|
data = await client.async_send_command(
|
|
11
19
|
{"command": "utils.parse_qr_code_string", "qr": qr_code_string}
|
|
12
20
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/__init__.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/association.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/driver.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/endpoint.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/firmware.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/log_config.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/log_message.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/node.py
RENAMED
|
File without changes
|
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/value.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/model/version.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/helpers.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/lock.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/multicast.py
RENAMED
|
File without changes
|
{zwave-js-server-python-0.32.0 → zwave-js-server-python-0.33.0}/zwave_js_server/util/node.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|