ESPHome BLE scanner support (#77123)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
J. Nick Koston 2022-08-23 04:41:50 -10:00 committed by GitHub
parent c975146146
commit 7f001cc1d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 4 deletions

View file

@ -52,6 +52,8 @@ from homeassistant.helpers.service import async_set_service_schema
from homeassistant.helpers.storage import Store
from homeassistant.helpers.template import Template
from .bluetooth import async_connect_scanner
# Import config flow so that it's added to the registry
from .entry_data import RuntimeEntryData
@ -286,6 +288,8 @@ 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.has_bluetooth_proxy:
await async_connect_scanner(hass, entry, cli)
hass.async_create_task(entry_data.async_save_to_store())
except APIConnectionError as err: