From d8a81a54d8f5910d8fe7142e022d921185e27785 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 2 Sep 2021 17:11:03 -1000 Subject: [PATCH] Narrow zwave_js USB discovery (#55613) - Avoid triggering discovery when we can know in advance the device is not a Z-Wave stick --- homeassistant/components/zwave_js/config_flow.py | 5 ----- homeassistant/components/zwave_js/manifest.json | 2 +- homeassistant/generated/usb.py | 3 ++- tests/components/zwave_js/test_config_flow.py | 5 +---- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/zwave_js/config_flow.py b/homeassistant/components/zwave_js/config_flow.py index 55266d02389..a4f7343f0e0 100644 --- a/homeassistant/components/zwave_js/config_flow.py +++ b/homeassistant/components/zwave_js/config_flow.py @@ -326,11 +326,6 @@ class ConfigFlow(BaseZwaveJSFlow, config_entries.ConfigFlow, domain=DOMAIN): device = discovery_info["device"] manufacturer = discovery_info["manufacturer"] description = discovery_info["description"] - # The Nortek sticks are a special case since they - # have a Z-Wave and a Zigbee radio. We need to reject - # the Zigbee radio. - if vid == "10C4" and pid == "8A2A" and "Z-Wave" not in description: - return self.async_abort(reason="not_zwave_device") # Zooz uses this vid/pid, but so do 2652 sticks if vid == "10C4" and pid == "EA60" and "2652" in description: return self.async_abort(reason="not_zwave_device") diff --git a/homeassistant/components/zwave_js/manifest.json b/homeassistant/components/zwave_js/manifest.json index 7953e33d6e3..ad8ec22befb 100644 --- a/homeassistant/components/zwave_js/manifest.json +++ b/homeassistant/components/zwave_js/manifest.json @@ -9,7 +9,7 @@ "iot_class": "local_push", "usb": [ {"vid":"0658","pid":"0200","known_devices":["Aeotec Z-Stick Gen5+", "Z-WaveMe UZB"]}, - {"vid":"10C4","pid":"8A2A","known_devices":["Nortek HUSBZB-1"]}, + {"vid":"10C4","pid":"8A2A","description":"*z-wave*","known_devices":["Nortek HUSBZB-1"]}, {"vid":"10C4","pid":"EA60","known_devices":["Aeotec Z-Stick 7", "Silicon Labs UZB-7", "Zooz ZST10 700"]} ] } diff --git a/homeassistant/generated/usb.py b/homeassistant/generated/usb.py index 477a762ae62..844c09fea40 100644 --- a/homeassistant/generated/usb.py +++ b/homeassistant/generated/usb.py @@ -32,7 +32,8 @@ USB = [ { "domain": "zwave_js", "vid": "10C4", - "pid": "8A2A" + "pid": "8A2A", + "description": "*z-wave*" }, { "domain": "zwave_js", diff --git a/tests/components/zwave_js/test_config_flow.py b/tests/components/zwave_js/test_config_flow.py index 5e994a2ac7a..757dc6d5364 100644 --- a/tests/components/zwave_js/test_config_flow.py +++ b/tests/components/zwave_js/test_config_flow.py @@ -756,10 +756,7 @@ async def test_usb_discovery_already_running(hass, supervisor, addon_running): @pytest.mark.parametrize( "discovery_info", - [ - NORTEK_ZIGBEE_DISCOVERY_INFO, - CP2652_ZIGBEE_DISCOVERY_INFO, - ], + [CP2652_ZIGBEE_DISCOVERY_INFO], ) async def test_abort_usb_discovery_aborts_specific_devices( hass, supervisor, addon_options, discovery_info