mirror of
https://github.com/home-assistant/core.git
synced 2026-09-26 09:23:17 -04:00
Split the Crownstone user flow init from its data (#180806)
This commit is contained in:
@@ -22,6 +22,7 @@ from homeassistant.components.crownstone.const import (
|
||||
MANUAL_PATH,
|
||||
)
|
||||
from homeassistant.components.usb import USBDevice
|
||||
from homeassistant.config_entries import SOURCE_USER
|
||||
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.data_entry_flow import FlowResultType
|
||||
@@ -143,8 +144,15 @@ async def start_config_flow(hass: HomeAssistant, mocked_cloud: MagicMock):
|
||||
"homeassistant.components.crownstone.config_flow.CrownstoneCloud",
|
||||
return_value=mocked_cloud,
|
||||
):
|
||||
return await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": "user"}, data=mocked_login_input
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["step_id"] == "user"
|
||||
|
||||
return await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"], user_input=mocked_login_input
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user