Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support controller.cancel_secure_bootstrap_s2 #1122

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def version_data_fixture():
"serverVersion": "test_server_version",
"homeId": "test_home_id",
"minSchemaVersion": 0,
"maxSchemaVersion": 39,
"maxSchemaVersion": 40,
}


Expand Down
15 changes: 15 additions & 0 deletions test/model/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,21 @@ async def test_stop_inclusion(controller, uuid4, mock_command):
}


async def test_cancel_secure_bootstrap_s2(controller, uuid4, mock_command):
"""Test cancel secure bootstrap S2."""
ack_commands = mock_command(
{"command": "controller.cancel_secure_bootstrap_s2"},
{},
)
assert await controller.async_cancel_secure_bootstrap_s2() is None

assert len(ack_commands) == 1
assert ack_commands[0] == {
"command": "controller.cancel_secure_bootstrap_s2",
"messageId": uuid4,
}


async def test_begin_exclusion(controller, uuid4, mock_command):
"""Test begin exclusion."""
ack_commands = mock_command(
Expand Down
2 changes: 1 addition & 1 deletion test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ async def test_additional_user_agent_components(client_session, url):
{
"command": "initialize",
"messageId": "initialize",
"schemaVersion": 39,
"schemaVersion": 40,
"additionalUserAgentComponents": {
"zwave-js-server-python": __version__,
"foo": "bar",
Expand Down
2 changes: 1 addition & 1 deletion test/test_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def test_dump_additional_user_agent_components(
{
"command": "initialize",
"messageId": "initialize",
"schemaVersion": 39,
"schemaVersion": 40,
"additionalUserAgentComponents": {
"zwave-js-server-python": __version__,
"foo": "bar",
Expand Down
2 changes: 1 addition & 1 deletion test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_dump_state(
assert captured.out == (
"{'type': 'version', 'driverVersion': 'test_driver_version', "
"'serverVersion': 'test_server_version', 'homeId': 'test_home_id', "
"'minSchemaVersion': 0, 'maxSchemaVersion': 39}\n"
"'minSchemaVersion': 0, 'maxSchemaVersion': 40}\n"
"{'type': 'result', 'success': True, 'result': {}, 'messageId': 'initialize'}\n"
"test_result\n"
)
Expand Down
2 changes: 1 addition & 1 deletion zwave_js_server/const/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# minimal server schema version we can handle
MIN_SERVER_SCHEMA_VERSION = 39
# max server schema version we can handle (and our code is compatible with)
MAX_SERVER_SCHEMA_VERSION = 39
MAX_SERVER_SCHEMA_VERSION = 40

VALUE_UNKNOWN = "unknown"

Expand Down
6 changes: 6 additions & 0 deletions zwave_js_server/model/controller/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ async def async_stop_inclusion(self) -> bool:
)
return cast(bool, data["success"])

async def async_cancel_secure_bootstrap_s2(self) -> None:
"""Send cancelSecureBootstrapS2 command to Controller."""
await self.client.async_send_command(
{"command": "controller.cancel_secure_bootstrap_s2"}, require_schema=40
)

async def async_begin_exclusion(
self, strategy: ExclusionStrategy | None = None
) -> bool:
Expand Down