mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Use reference strings in Upb (#41340)
* Update strings.json * Update config_flow.py * Update test_config_flow.py
This commit is contained in:
parent
f256d0a4ea
commit
ba81c0c043
@ -89,7 +89,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
try:
|
try:
|
||||||
if self._url_already_configured(_make_url_from_data(user_input)):
|
if self._url_already_configured(_make_url_from_data(user_input)):
|
||||||
return self.async_abort(reason="address_already_configured")
|
return self.async_abort(reason="already_configured")
|
||||||
network_id, info = await _validate_input(user_input)
|
network_id, info = await _validate_input(user_input)
|
||||||
except CannotConnect:
|
except CannotConnect:
|
||||||
errors["base"] = "cannot_connect"
|
errors["base"] = "cannot_connect"
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"cannot_connect": "Failed to connect to UPB PIM, please try again.",
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
||||||
"invalid_upb_file": "Missing or invalid UPB UPStart export file, check the name and path of the file.",
|
"invalid_upb_file": "Missing or invalid UPB UPStart export file, check the name and path of the file.",
|
||||||
"unknown": "Unexpected error."
|
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"address_already_configured": "An UPB PIM with this address is already configured."
|
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ async def test_form_user_with_already_configured(hass):
|
|||||||
_ = await valid_tcp_flow(hass)
|
_ = await valid_tcp_flow(hass)
|
||||||
result2 = await valid_tcp_flow(hass)
|
result2 = await valid_tcp_flow(hass)
|
||||||
assert result2["type"] == "abort"
|
assert result2["type"] == "abort"
|
||||||
assert result2["reason"] == "address_already_configured"
|
assert result2["reason"] == "already_configured"
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user