From 9f77e275e96b073271e77de1ee9ab1e1c5460f8e Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Mon, 26 Feb 2024 13:19:37 +0000 Subject: [PATCH] Add title to reauthenticate integration issue (#111275) * Add title to reauthenticate integration issue * Fix translation placeholder in test * Update translation placeholders in test_init.py * Update integration reauthentication message * Update string --- homeassistant/config_entries.py | 1 + homeassistant/strings.json | 2 +- tests/components/kitchen_sink/test_init.py | 4 ++-- tests/test_config_entries.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 7804ae66600..d7994305712 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -891,6 +891,7 @@ class ConfigEntry: issue_domain=self.domain, severity=ir.IssueSeverity.ERROR, translation_key="config_entry_reauth", + translation_placeholders={"name": self.title}, ) @callback diff --git a/homeassistant/strings.json b/homeassistant/strings.json index 6e6499e0d19..cfe1061bce6 100644 --- a/homeassistant/strings.json +++ b/homeassistant/strings.json @@ -68,7 +68,7 @@ "config_flow": { "title": { "oauth2_pick_implementation": "Pick authentication method", - "reauth": "Reauthenticate integration", + "reauth": "Authentication expired for {name}", "via_hassio_addon": "{name} via Home Assistant add-on" }, "description": { diff --git a/tests/components/kitchen_sink/test_init.py b/tests/components/kitchen_sink/test_init.py index c65d53478d2..b3f303fcfe1 100644 --- a/tests/components/kitchen_sink/test_init.py +++ b/tests/components/kitchen_sink/test_init.py @@ -205,7 +205,7 @@ async def test_issues_created( "learn_more_url": None, "severity": "error", "translation_key": "config_entry_reauth", - "translation_placeholders": None, + "translation_placeholders": {"name": "Kitchen Sink"}, "ignored": False, }, ] @@ -322,7 +322,7 @@ async def test_issues_created( "learn_more_url": None, "severity": "error", "translation_key": "config_entry_reauth", - "translation_placeholders": None, + "translation_placeholders": {"name": "Kitchen Sink"}, "ignored": False, }, ] diff --git a/tests/test_config_entries.py b/tests/test_config_entries.py index 36a38b98622..bb38437ee09 100644 --- a/tests/test_config_entries.py +++ b/tests/test_config_entries.py @@ -1044,7 +1044,7 @@ async def test_reauth_issue(hass: HomeAssistant) -> None: learn_more_url=None, severity=ir.IssueSeverity.ERROR, translation_key="config_entry_reauth", - translation_placeholders=None, + translation_placeholders={"name": "test_title"}, ) result = await hass.config_entries.flow.async_configure(issue.data["flow_id"], {})