Simplify ZHA config entry title (#76991)

This commit is contained in:
Erik Montnemery 2022-08-18 16:58:44 +02:00 committed by GitHub
parent 88a5b90489
commit 21ebd1f612
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View file

@ -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,

View file

@ -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",