Split the SleepIQ user flow init from its data (#180666)

This commit is contained in:
Franck Nijhof
2026-08-29 20:52:49 +02:00
committed by GitHub
parent 7bb0412239
commit 4b5930cc0c
+9 -2
View File
@@ -47,7 +47,7 @@ async def test_show_set_form(hass: HomeAssistant) -> None:
"""Test that the setup form is served."""
with patch("asyncsleepiq.AsyncSleepIQ.login"):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=None
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
@@ -68,7 +68,14 @@ async def test_login_failure(hass: HomeAssistant, side_effect, error) -> None:
side_effect=side_effect,
):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}, data=SLEEPIQ_CONFIG
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] is FlowResultType.FORM
assert result["step_id"] == "user"
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input=SLEEPIQ_CONFIG
)
assert result["type"] is FlowResultType.FORM