mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Use reference strings for Zoneminder config flow (#41103)
This commit is contained in:
parent
f1cb8e209e
commit
20bacb6918
@ -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(
|
||||
|
@ -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." }
|
||||
}
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user