Make sure all discovery flows are using the helper (#76641)

This commit is contained in:
J. Nick Koston 2022-08-12 03:25:23 -10:00 committed by GitHub
parent a86397cc10
commit eeb9a9f058
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 132 additions and 117 deletions

View file

@ -29,6 +29,7 @@ from homeassistant.const import (
)
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import discovery_flow
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
@ -76,7 +77,8 @@ async def async_discover(hass):
gdm = GDM()
await hass.async_add_executor_job(gdm.scan)
for server_data in gdm.entries:
await hass.config_entries.flow.async_init(
discovery_flow.async_create_flow(
hass,
DOMAIN,
context={CONF_SOURCE: config_entries.SOURCE_INTEGRATION_DISCOVERY},
data=server_data,