From eab0ff5185c0a2c256d634dbd28e1129bcc1a86b Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Sat, 27 Aug 2022 21:27:41 -0400 Subject: [PATCH] Bump zwave-js-server-python to 0.41.0 (#76903) --- homeassistant/components/zwave_js/api.py | 13 +++++++------ homeassistant/components/zwave_js/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/zwave_js/test_api.py | 7 ++++--- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/zwave_js/api.py b/homeassistant/components/zwave_js/api.py index 1a9435509f2..2e565a3be7c 100644 --- a/homeassistant/components/zwave_js/api.py +++ b/homeassistant/components/zwave_js/api.py @@ -11,6 +11,7 @@ import voluptuous as vol from zwave_js_server.client import Client from zwave_js_server.const import ( CommandClass, + ExclusionStrategy, InclusionStrategy, LogLevel, Protocols, @@ -153,7 +154,7 @@ STATUS = "status" REQUESTED_SECURITY_CLASSES = "requested_security_classes" FEATURE = "feature" -UNPROVISION = "unprovision" +STRATEGY = "strategy" # https://github.com/zwave-js/node-zwave-js/blob/master/packages/core/src/security/QR.ts#L41 MINIMUM_QR_STRING_LENGTH = 52 @@ -480,12 +481,12 @@ async def websocket_network_status( "sdk_version": controller.sdk_version, "type": controller.controller_type, "own_node_id": controller.own_node_id, - "is_secondary": controller.is_secondary, + "is_primary": controller.is_primary, "is_using_home_id_from_other_network": controller.is_using_home_id_from_other_network, "is_sis_present": controller.is_SIS_present, "was_real_primary": controller.was_real_primary, - "is_static_update_controller": controller.is_static_update_controller, - "is_slave": controller.is_slave, + "is_suc": controller.is_suc, + "node_type": controller.node_type, "firmware_version": controller.firmware_version, "manufacturer_id": controller.manufacturer_id, "product_id": controller.product_id, @@ -1056,7 +1057,7 @@ async def websocket_stop_exclusion( { vol.Required(TYPE): "zwave_js/remove_node", vol.Required(ENTRY_ID): str, - vol.Optional(UNPROVISION): bool, + vol.Optional(STRATEGY): vol.Coerce(ExclusionStrategy), } ) @websocket_api.async_response @@ -1106,7 +1107,7 @@ async def websocket_remove_node( controller.on("node removed", node_removed), ] - result = await controller.async_begin_exclusion(msg.get(UNPROVISION)) + result = await controller.async_begin_exclusion(msg.get(STRATEGY)) connection.send_result( msg[ID], result, diff --git a/homeassistant/components/zwave_js/manifest.json b/homeassistant/components/zwave_js/manifest.json index 5f9c8df7afc..b906efec96c 100644 --- a/homeassistant/components/zwave_js/manifest.json +++ b/homeassistant/components/zwave_js/manifest.json @@ -3,7 +3,7 @@ "name": "Z-Wave", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/zwave_js", - "requirements": ["pyserial==3.5", "zwave-js-server-python==0.40.0"], + "requirements": ["pyserial==3.5", "zwave-js-server-python==0.41.0"], "codeowners": ["@home-assistant/z-wave"], "dependencies": ["usb", "http", "websocket_api"], "iot_class": "local_push", diff --git a/requirements_all.txt b/requirements_all.txt index cc1e87871d0..a637284cbd8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2575,7 +2575,7 @@ zigpy==0.50.2 zm-py==0.5.2 # homeassistant.components.zwave_js -zwave-js-server-python==0.40.0 +zwave-js-server-python==0.41.0 # homeassistant.components.zwave_me zwave_me_ws==0.2.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 0d76676ec8f..fd60fae2e00 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1761,7 +1761,7 @@ zigpy-znp==0.8.2 zigpy==0.50.2 # homeassistant.components.zwave_js -zwave-js-server-python==0.40.0 +zwave-js-server-python==0.41.0 # homeassistant.components.zwave_me zwave_me_ws==0.2.4 diff --git a/tests/components/zwave_js/test_api.py b/tests/components/zwave_js/test_api.py index 68618edfbeb..0d633720639 100644 --- a/tests/components/zwave_js/test_api.py +++ b/tests/components/zwave_js/test_api.py @@ -6,6 +6,7 @@ from unittest.mock import patch import pytest from zwave_js_server.const import ( + ExclusionStrategy, InclusionState, InclusionStrategy, LogLevel, @@ -68,8 +69,8 @@ from homeassistant.components.zwave_js.api import ( SECURITY_CLASSES, SPECIFIC_DEVICE_CLASS, STATUS, + STRATEGY, TYPE, - UNPROVISION, VALUE, VERSION, ) @@ -1528,7 +1529,7 @@ async def test_remove_node( ID: 2, TYPE: "zwave_js/remove_node", ENTRY_ID: entry.entry_id, - UNPROVISION: True, + STRATEGY: ExclusionStrategy.EXCLUDE_ONLY, } ) @@ -1538,7 +1539,7 @@ async def test_remove_node( assert len(client.async_send_command.call_args_list) == 1 assert client.async_send_command.call_args[0][0] == { "command": "controller.begin_exclusion", - "unprovision": True, + "strategy": 0, } # Test FailedZWaveCommand is caught