Use reference strings for Zoneminder config flow (#41103)

This commit is contained in:
groot406 2020-10-03 15:02:30 +02:00 committed by GitHub
parent f1cb8e209e
commit 20bacb6918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -94,8 +94,8 @@ class ClientAvailabilityResult(Enum):
"""Client availability test result."""
AVAILABLE = "available"
ERROR_AUTH_FAIL = "auth_fail"
ERROR_CONNECTION_ERROR = "connection_error"
ERROR_AUTH_FAIL = "invalid_auth"
ERROR_CONNECTION_ERROR = "cannot_connect"
async def async_test_client_availability(

View File

@ -16,12 +16,12 @@
}
},
"abort": {
"auth_fail": "Username or password is incorrect.",
"connection_error": "Failed to connect to a ZoneMinder server."
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"error": {
"auth_fail": "Username or password is incorrect.",
"connection_error": "Failed to connect to a ZoneMinder server."
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"create_entry": { "default": "ZoneMinder server added." }
}

View File

@ -45,7 +45,7 @@ async def test_import(hass: HomeAssistant) -> None:
)
assert result
assert result["type"] == "abort"
assert result["reason"] == "auth_fail"
assert result["reason"] == "invalid_auth"
zm_client.login.return_value = True
result = await hass.config_entries.flow.async_init(