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
pull/42004/head
Ronaldo Lima 2020-10-17 15:07:44 +02:00 committed by GitHub
parent d0b1b0a39e
commit 121613f5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -6,6 +6,6 @@
"data": { "radius": "Radius" }
}
},
"error": { "identifier_exists": "Location already registered" }
"abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_location%]" }
}
}

View File

@ -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):