Split the eGauge user flow init from its data (#180747)

This commit is contained in:
Franck Nijhof
2026-08-30 12:21:23 +02:00
committed by GitHub
parent 5bca6514d0
commit a6964e797c
+18 -6
View File
@@ -73,9 +73,15 @@ async def test_user_flow_errors(
mock_egauge_client.get_device_serial_number.side_effect = side_effect
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
DOMAIN, context={"source": 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={
CONF_HOST: "192.168.1.100",
CONF_USERNAME: "admin",
CONF_PASSWORD: "wrong",
@@ -119,9 +125,15 @@ async def test_user_flow_already_configured(
mock_config_entry.add_to_hass(hass)
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_USER},
data={
DOMAIN, context={"source": 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={
CONF_HOST: "http://192.168.1.200",
CONF_USERNAME: "admin",
CONF_PASSWORD: "secret",