diff --git a/homeassistant/components/bluetooth/config_flow.py b/homeassistant/components/bluetooth/config_flow.py index 0a414b36144..76cf167790f 100644 --- a/homeassistant/components/bluetooth/config_flow.py +++ b/homeassistant/components/bluetooth/config_flow.py @@ -108,7 +108,13 @@ class BluetoothConfigFlow(ConfigFlow, domain=DOMAIN): if details[ADAPTER_ADDRESS] not in configured_addresses ] if not unconfigured_adapters: - return self.async_abort(reason="no_adapters") + ignored_adapters = len( + self._async_current_entries(include_ignore=True) + ) - len(self._async_current_entries(include_ignore=False)) + return self.async_abort( + reason="no_adapters", + description_placeholders={"ignored_adapters": str(ignored_adapters)}, + ) if len(unconfigured_adapters) == 1: self._adapter = list(self._adapters)[0] self._details = self._adapters[self._adapter] diff --git a/homeassistant/components/bluetooth/strings.json b/homeassistant/components/bluetooth/strings.json index 97662dbb9c7..a988477778d 100644 --- a/homeassistant/components/bluetooth/strings.json +++ b/homeassistant/components/bluetooth/strings.json @@ -29,7 +29,7 @@ }, "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_service%]", - "no_adapters": "No unconfigured Bluetooth adapters found" + "no_adapters": "No unconfigured Bluetooth adapters found. There are {ignored_adapters} ignored adapters." } }, "options": { diff --git a/tests/components/bluetooth/test_config_flow.py b/tests/components/bluetooth/test_config_flow.py index 204e550ed6d..e38eb1d4a8a 100644 --- a/tests/components/bluetooth/test_config_flow.py +++ b/tests/components/bluetooth/test_config_flow.py @@ -394,3 +394,21 @@ async def test_options_flow_enabled_linux( response = await ws_client.receive_json() assert response["result"][0]["supports_options"] is True await hass.config_entries.async_unload(entry.entry_id) + + +async def test_async_step_user_linux_adapter_is_ignored(hass, one_adapter): + """Test we give a hint that the adapter is ignored.""" + entry = MockConfigEntry( + domain=DOMAIN, + unique_id="00:00:00:00:00:01", + source=config_entries.SOURCE_IGNORE, + ) + entry.add_to_hass(hass) + result = await hass.config_entries.flow.async_init( + DOMAIN, + context={"source": config_entries.SOURCE_USER}, + data={}, + ) + assert result["type"] == FlowResultType.ABORT + assert result["reason"] == "no_adapters" + assert result["description_placeholders"] == {"ignored_adapters": "1"}