From c7027e2828034ae385f4a87b91cd76cea8fdcc8c Mon Sep 17 00:00:00 2001 From: SNoof85 Date: Mon, 5 Oct 2020 15:13:37 +0200 Subject: [PATCH] Use reference strings in Notion (#41211) --- homeassistant/components/notion/config_flow.py | 2 +- homeassistant/components/notion/strings.json | 6 +++--- tests/components/notion/test_config_flow.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/notion/config_flow.py b/homeassistant/components/notion/config_flow.py index 58c5c0d44ee..bcbd22bccc6 100644 --- a/homeassistant/components/notion/config_flow.py +++ b/homeassistant/components/notion/config_flow.py @@ -47,6 +47,6 @@ class NotionFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): user_input[CONF_USERNAME], user_input[CONF_PASSWORD], session ) except NotionError: - return await self._show_form({"base": "invalid_credentials"}) + return await self._show_form({"base": "invalid_auth"}) return self.async_create_entry(title=user_input[CONF_USERNAME], data=user_input) diff --git a/homeassistant/components/notion/strings.json b/homeassistant/components/notion/strings.json index 1fbe4837f7e..401f0095e30 100644 --- a/homeassistant/components/notion/strings.json +++ b/homeassistant/components/notion/strings.json @@ -10,11 +10,11 @@ } }, "error": { - "invalid_credentials": "Invalid username or password", + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]", "no_devices": "No devices found in account" }, "abort": { - "already_configured": "This username is already in use." + "already_configured": "[%key:common::config_flow::abort::already_configured_account%]" } } -} \ No newline at end of file +} diff --git a/tests/components/notion/test_config_flow.py b/tests/components/notion/test_config_flow.py index 6aaf7df9505..7a887ac3468 100644 --- a/tests/components/notion/test_config_flow.py +++ b/tests/components/notion/test_config_flow.py @@ -53,7 +53,7 @@ async def test_invalid_credentials(hass, mock_aionotion): flow.context = {"source": SOURCE_USER} result = await flow.async_step_user(user_input=conf) - assert result["errors"] == {"base": "invalid_credentials"} + assert result["errors"] == {"base": "invalid_auth"} async def test_show_form(hass):