mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Fix missing title placeholders during unifiprotect reauth (#70067)
This commit is contained in:
parent
1b48d7eda1
commit
03c91dad78
@ -259,6 +259,10 @@ class ProtectFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
await self.hass.config_entries.async_reload(self.entry.entry_id)
|
await self.hass.config_entries.async_reload(self.entry.entry_id)
|
||||||
return self.async_abort(reason="reauth_successful")
|
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(
|
return self.async_show_form(
|
||||||
step_id="reauth_confirm",
|
step_id="reauth_confirm",
|
||||||
data_schema=vol.Schema(
|
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 result["type"] == RESULT_TYPE_FORM
|
||||||
assert not result["errors"]
|
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(
|
with patch(
|
||||||
"homeassistant.components.unifiprotect.config_flow.ProtectApiClient.get_nvr",
|
"homeassistant.components.unifiprotect.config_flow.ProtectApiClient.get_nvr",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user