mirror of
https://github.com/home-assistant/core.git
synced 2025-04-22 16:27:56 +00:00
Use common strings for Onvif config flow (#41170)
* Use common strings for Onvif config flow * Fix tests * Update homeassistant/components/onvif/strings.json Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
c7027e2828
commit
dde465da48
@ -262,7 +262,7 @@ class OnvifFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
return self.async_abort(reason="onvif_error")
|
||||
|
||||
except Fault:
|
||||
errors["base"] = "connection_failed"
|
||||
errors["base"] = "cannot_connect"
|
||||
|
||||
return self.async_show_form(step_id="auth", errors=errors)
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "ONVIF device is already configured.",
|
||||
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
|
||||
"already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]",
|
||||
"onvif_error": "Error setting up ONVIF device. Check logs for more information.",
|
||||
"no_h264": "There were no H264 streams available. Check the profile configuration on your device.",
|
||||
"no_mac": "Could not configure unique ID for ONVIF device."
|
||||
},
|
||||
"error": {
|
||||
"connection_failed": "Could not connect to ONVIF service with provided credentials."
|
||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
|
@ -531,7 +531,7 @@ async def test_flow_import_onvif_auth_error(hass):
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["step_id"] == "auth"
|
||||
assert result["errors"]["base"] == "connection_failed"
|
||||
assert result["errors"]["base"] == "cannot_connect"
|
||||
|
||||
|
||||
async def test_option_flow(hass):
|
||||
|
Loading…
x
Reference in New Issue
Block a user