From 4e28ae8e3a03b9cf8f6529e5a3e7ef7e07def4f3 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Wed, 28 Oct 2020 13:29:28 +0100 Subject: [PATCH] Use common strings in life360 config flow (#42375) * Use common strings for life360 config flow * Address feedback comments * Keep two space indentation * Fix indentation hopefully --- homeassistant/components/life360/config_flow.py | 6 +++--- homeassistant/components/life360/strings.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/life360/config_flow.py b/homeassistant/components/life360/config_flow.py index 83ad4138de8..de37068cd56 100644 --- a/homeassistant/components/life360/config_flow.py +++ b/homeassistant/components/life360/config_flow.py @@ -58,10 +58,10 @@ class Life360ConfigFlow(config_entries.ConfigFlow): _LOGGER.error( "Unexpected error communicating with Life360 server: %s", error ) - errors["base"] = "unexpected" + errors["base"] = "unknown" else: if self._username in self.configured_usernames: - errors["base"] = "user_already_configured" + errors["base"] = "already_configured" else: return self.async_create_entry( title=self._username, @@ -99,7 +99,7 @@ class Life360ConfigFlow(config_entries.ConfigFlow): _LOGGER.error( "Unexpected error communicating with Life360 server: %s", error ) - return self.async_abort(reason="unexpected") + return self.async_abort(reason="unknown") return self.async_create_entry( title=f"{username} (from configuration)", data={ diff --git a/homeassistant/components/life360/strings.json b/homeassistant/components/life360/strings.json index 4018a899f44..0d554759ee7 100644 --- a/homeassistant/components/life360/strings.json +++ b/homeassistant/components/life360/strings.json @@ -13,15 +13,15 @@ "error": { "invalid_username": "Invalid username", "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]", - "user_already_configured": "[%key:common::config_flow::abort::already_configured_account%]", - "unexpected": "Unexpected error communicating with Life360 server" + "already_configured": "[%key:common::config_flow::abort::already_configured_account%]", + "unknown": "[%key:common::config_flow::error::unknown%]" }, "create_entry": { "default": "To set advanced options, see [Life360 documentation]({docs_url})." }, "abort": { "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]", - "user_already_configured": "[%key:common::config_flow::abort::already_configured_account%]" + "unknown": "[%key:common::config_flow::error::unknown%]" } } } \ No newline at end of file