mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Connect esphome ble scanner as soon as possible (#83728)
Other integration depend on it being available so connect it first
This commit is contained in:
parent
642cefb035
commit
9094d73df1
@ -259,6 +259,12 @@ async def async_setup_entry( # noqa: C901
|
||||
if entry_data.device_info.name:
|
||||
cli.expected_name = entry_data.device_info.name
|
||||
reconnect_logic.name = entry_data.device_info.name
|
||||
|
||||
if device_info.bluetooth_proxy_version:
|
||||
entry_data.disconnect_callbacks.append(
|
||||
await async_connect_scanner(hass, entry, cli, entry_data)
|
||||
)
|
||||
|
||||
device_id = _async_setup_device_registry(
|
||||
hass, entry, entry_data.device_info
|
||||
)
|
||||
@ -270,10 +276,6 @@ async def async_setup_entry( # noqa: C901
|
||||
await cli.subscribe_states(entry_data.async_update_state)
|
||||
await cli.subscribe_service_calls(async_on_service_call)
|
||||
await cli.subscribe_home_assistant_states(async_on_state_subscription)
|
||||
if entry_data.device_info.bluetooth_proxy_version:
|
||||
entry_data.disconnect_callbacks.append(
|
||||
await async_connect_scanner(hass, entry, cli, entry_data)
|
||||
)
|
||||
|
||||
hass.async_create_task(entry_data.async_save_to_store())
|
||||
except APIConnectionError as err:
|
||||
|
Loading…
x
Reference in New Issue
Block a user