Use reference strings in iaqualink (#41292)
* Update strings.json * Update config_flow.py * Update test_config_flow.py
This commit is contained in:
parent
72cbdbbe36
commit
7a12a16fc5
3 changed files with 6 additions and 6 deletions
|
@ -23,7 +23,7 @@ class AqualinkFlowHandler(config_entries.ConfigFlow):
|
|||
# Supporting a single account.
|
||||
entries = self.hass.config_entries.async_entries(DOMAIN)
|
||||
if entries:
|
||||
return self.async_abort(reason="already_setup")
|
||||
return self.async_abort(reason="single_instance_allowed")
|
||||
|
||||
errors = {}
|
||||
|
||||
|
@ -36,7 +36,7 @@ class AqualinkFlowHandler(config_entries.ConfigFlow):
|
|||
await aqualink.login()
|
||||
return self.async_create_entry(title=username, data=user_input)
|
||||
except AqualinkLoginException:
|
||||
errors["base"] = "connection_failure"
|
||||
errors["base"] = "cannot_connect"
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
}
|
||||
},
|
||||
"error": {
|
||||
"connection_failure": "Unable to connect to iAqualink. Check your username and password."
|
||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||
},
|
||||
"abort": {
|
||||
"already_setup": "You can only configure a single iAqualink connection."
|
||||
"single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ async def test_with_invalid_credentials(hass, step):
|
|||
|
||||
assert result["type"] == "form"
|
||||
assert result["step_id"] == "user"
|
||||
assert result["errors"] == {"base": "connection_failure"}
|
||||
assert result["errors"] == {"base": "cannot_connect"}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("step", ["import", "user"])
|
||||
|
|
Loading…
Add table
Reference in a new issue