From 121613f5e6990e39ae0ce836f790917e538c6703 Mon Sep 17 00:00:00 2001 From: Ronaldo Lima <4389565+ronal2do@users.noreply.github.com> Date: Sat, 17 Oct 2020 15:07:44 +0200 Subject: [PATCH] Use common string in GeoNet NZ Volcano (#41981) * add GeoNet NZ Volcano to home-assistant#40578 * change key from already_configured_location to already_configured on GeoNet NZ Volkano --- homeassistant/components/geonetnz_volcano/config_flow.py | 2 +- homeassistant/components/geonetnz_volcano/strings.json | 2 +- tests/components/geonetnz_volcano/test_config_flow.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/geonetnz_volcano/config_flow.py b/homeassistant/components/geonetnz_volcano/config_flow.py index 9ea8b378fce..0658f073503 100644 --- a/homeassistant/components/geonetnz_volcano/config_flow.py +++ b/homeassistant/components/geonetnz_volcano/config_flow.py @@ -57,7 +57,7 @@ class GeonetnzVolcanoFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): identifier = f"{user_input[CONF_LATITUDE]}, {user_input[CONF_LONGITUDE]}" if identifier in configured_instances(self.hass): - return await self._show_form({"base": "identifier_exists"}) + return await self._show_form({"base": "already_configured"}) if self.hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL: user_input[CONF_UNIT_SYSTEM] = CONF_UNIT_SYSTEM_IMPERIAL diff --git a/homeassistant/components/geonetnz_volcano/strings.json b/homeassistant/components/geonetnz_volcano/strings.json index d364d76b2ed..09f523c5266 100644 --- a/homeassistant/components/geonetnz_volcano/strings.json +++ b/homeassistant/components/geonetnz_volcano/strings.json @@ -6,6 +6,6 @@ "data": { "radius": "Radius" } } }, - "error": { "identifier_exists": "Location already registered" } + "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_location%]" } } } diff --git a/tests/components/geonetnz_volcano/test_config_flow.py b/tests/components/geonetnz_volcano/test_config_flow.py index 91ca7a1f553..21d74bb5e96 100644 --- a/tests/components/geonetnz_volcano/test_config_flow.py +++ b/tests/components/geonetnz_volcano/test_config_flow.py @@ -23,7 +23,7 @@ async def test_duplicate_error(hass, config_entry): flow.hass = hass result = await flow.async_step_user(user_input=conf) - assert result["errors"] == {"base": "identifier_exists"} + assert result["errors"] == {"base": "already_configured"} async def test_show_form(hass):