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

@ -14,6 +14,7 @@ from homeassistant.components.http import HomeAssistantView
from homeassistant.const import ATTR_NAME, ATTR_SERVICE, EVENT_HOMEASSISTANT_START
from homeassistant.core import HomeAssistant, callback
from homeassistant.data_entry_flow import BaseServiceInfo
from homeassistant.helpers import discovery_flow
from .const import ATTR_ADDON, ATTR_CONFIG, ATTR_DISCOVERY, ATTR_UUID
from .handler import HassioAPIError
@ -99,7 +100,8 @@ class HassIODiscovery(HomeAssistantView):
config_data[ATTR_ADDON] = addon_info[ATTR_NAME]
# Use config flow
await self.hass.config_entries.flow.async_init(
discovery_flow.async_create_flow(
self.hass,
service,
context={"source": config_entries.SOURCE_HASSIO},
data=HassioServiceInfo(config=config_data),