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:
Diefferson Koderer Môro 2020-10-05 10:27:48 -03:00 committed by GitHub
parent c7027e2828
commit dde465da48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

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

View File

@ -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": {

View File

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