Fix missing title placeholders during unifiprotect reauth (#70067)
This commit is contained in:
parent
1b48d7eda1
commit
03c91dad78
2 changed files with 9 additions and 0 deletions
|
@ -259,6 +259,10 @@ class ProtectFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
await self.hass.config_entries.async_reload(self.entry.entry_id)
|
||||
return self.async_abort(reason="reauth_successful")
|
||||
|
||||
self.context["title_placeholders"] = {
|
||||
"name": self.entry.title,
|
||||
"ip_address": self.entry.data[CONF_HOST],
|
||||
}
|
||||
return self.async_show_form(
|
||||
step_id="reauth_confirm",
|
||||
data_schema=vol.Schema(
|
||||
|
|
|
@ -193,6 +193,11 @@ async def test_form_reauth_auth(hass: HomeAssistant, mock_nvr: NVR) -> None:
|
|||
)
|
||||
assert result["type"] == RESULT_TYPE_FORM
|
||||
assert not result["errors"]
|
||||
flows = hass.config_entries.flow.async_progress_by_handler(DOMAIN)
|
||||
assert flows[0]["context"]["title_placeholders"] == {
|
||||
"ip_address": "1.1.1.1",
|
||||
"name": "Mock Title",
|
||||
}
|
||||
|
||||
with patch(
|
||||
"homeassistant.components.unifiprotect.config_flow.ProtectApiClient.get_nvr",
|
||||
|
|
Loading…
Add table
Reference in a new issue