diff --git a/homeassistant/components/zha/config_flow.py b/homeassistant/components/zha/config_flow.py index 69da95e8528..94723e38d58 100644 --- a/homeassistant/components/zha/config_flow.py +++ b/homeassistant/components/zha/config_flow.py @@ -128,7 +128,7 @@ class ZhaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return self.async_abort(reason="not_zha_device") self._device_path = dev_path - self._title = usb.human_readable_device_name( + self._title = description or usb.human_readable_device_name( dev_path, serial_number, manufacturer, diff --git a/tests/components/zha/test_config_flow.py b/tests/components/zha/test_config_flow.py index 9a98b5e0caa..a769303a4c4 100644 --- a/tests/components/zha/test_config_flow.py +++ b/tests/components/zha/test_config_flow.py @@ -237,7 +237,7 @@ async def test_discovery_via_usb(detect_mock, hass): await hass.async_block_till_done() assert result2["type"] == FlowResultType.CREATE_ENTRY - assert "zigbee radio" in result2["title"] + assert result2["title"] == "zigbee radio" assert result2["data"] == { "device": { "baudrate": 115200, @@ -273,10 +273,7 @@ async def test_zigate_discovery_via_usb(detect_mock, hass): await hass.async_block_till_done() assert result2["type"] == FlowResultType.CREATE_ENTRY - assert ( - "zigate radio - /dev/ttyZIGBEE, s/n: 1234 - test - 6015:0403" - in result2["title"] - ) + assert result2["title"] == "zigate radio" assert result2["data"] == { "device": { "path": "/dev/ttyZIGBEE",