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 Volkanopull/42004/head
parent
d0b1b0a39e
commit
121613f5e6
|
@ -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
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
"data": { "radius": "Radius" }
|
||||
}
|
||||
},
|
||||
"error": { "identifier_exists": "Location already registered" }
|
||||
"abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_location%]" }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue