mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
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
This commit is contained in:
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]}"
|
identifier = f"{user_input[CONF_LATITUDE]}, {user_input[CONF_LONGITUDE]}"
|
||||||
if identifier in configured_instances(self.hass):
|
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:
|
if self.hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL:
|
||||||
user_input[CONF_UNIT_SYSTEM] = CONF_UNIT_SYSTEM_IMPERIAL
|
user_input[CONF_UNIT_SYSTEM] = CONF_UNIT_SYSTEM_IMPERIAL
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
"data": { "radius": "Radius" }
|
"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
|
flow.hass = hass
|
||||||
|
|
||||||
result = await flow.async_step_user(user_input=conf)
|
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):
|
async def test_show_form(hass):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user