mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 04:50:17 +00:00
Handle Bluetooth adapters in a crashed state (#115790)
* Skip bluetooth discovery for Bluetooth adapters in a crashed state * fixes * fixes * adjust * coverage * coverage * fix race
This commit is contained in:
@@ -32,6 +32,9 @@ async def test_options_flow_disabled_not_setup(
|
||||
domain=DOMAIN, data={}, options={}, unique_id=DEFAULT_ADDRESS
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
ws_client = await hass_ws_client(hass)
|
||||
|
||||
await ws_client.send_json(
|
||||
@@ -103,6 +106,19 @@ async def test_async_step_user_linux_one_adapter(
|
||||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_async_step_user_linux_crashed_adapter(
|
||||
hass: HomeAssistant, crashed_adapter: None
|
||||
) -> None:
|
||||
"""Test setting up manually with one crashed adapter on Linux."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_USER},
|
||||
data={},
|
||||
)
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "no_adapters"
|
||||
|
||||
|
||||
async def test_async_step_user_linux_two_adapters(
|
||||
hass: HomeAssistant, two_adapters: None
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user