mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Remember entered IP when error happend while setting up HomeWizard (#113815)
This commit is contained in:
parent
a9e857202d
commit
48553ece68
@ -66,11 +66,14 @@ class HomeWizardConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
data=user_input,
|
||||
)
|
||||
|
||||
user_input = user_input or {}
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
data_schema=Schema(
|
||||
{
|
||||
Required(CONF_IP_ADDRESS): str,
|
||||
Required(
|
||||
CONF_IP_ADDRESS, default=user_input.get(CONF_IP_ADDRESS)
|
||||
): str,
|
||||
}
|
||||
),
|
||||
errors=errors,
|
||||
|
@ -290,6 +290,7 @@ async def test_error_flow(
|
||||
|
||||
assert result["type"] == FlowResultType.FORM
|
||||
assert result["errors"] == {"base": reason}
|
||||
assert result["data_schema"]({}) == {CONF_IP_ADDRESS: "127.0.0.1"}
|
||||
|
||||
# Recover from error
|
||||
mock_homewizardenergy.device.side_effect = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user