Skip to content
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 @@ -246,7 +246,7 @@ def version_data_fixture() -> dict[str, Any]:
"serverVersion": "test_server_version",
"homeId": "test_home_id",
"minSchemaVersion": 0,
"maxSchemaVersion": 42,
"maxSchemaVersion": 43,
}


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


async def test_toggle_rf(controller, uuid4, mock_command):
"""Test toggle RF."""
ack_commands = mock_command(
{"command": "controller.toggle_rf"},
{"success": True},
)
assert await controller.async_toggle_rf(True)

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


async def test_get_known_lifeline_routes(
multisensor_6, ring_keypad, wallmote_central_scene, uuid4, 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 @@ -463,7 +463,7 @@ async def test_additional_user_agent_components(client_session, url):
{
"command": "initialize",
"messageId": "initialize",
"schemaVersion": 42,
"schemaVersion": 43,
"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": 42,
"schemaVersion": 43,
"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': 42}\n"
"'minSchemaVersion': 0, 'maxSchemaVersion': 43}\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 = 41
# max server schema version we can handle (and our code is compatible with)
MAX_SERVER_SCHEMA_VERSION = 42
MAX_SERVER_SCHEMA_VERSION = 43

VALUE_UNKNOWN = "unknown"

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

async def async_toggle_rf(self, enable: bool) -> bool:
"""Send toggleRF command to Controller."""
data = await self.client.async_send_command(
{"command": "controller.toggle_rf", "enable": enable}, require_schema=43
)
return cast(bool, data["success"])

async def async_get_known_lifeline_routes(
self,
) -> dict[Node, ControllerLifelineRoutes]:
Expand Down