mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +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."""
|
"""Client availability test result."""
|
||||||
|
|
||||||
AVAILABLE = "available"
|
AVAILABLE = "available"
|
||||||
ERROR_AUTH_FAIL = "auth_fail"
|
ERROR_AUTH_FAIL = "invalid_auth"
|
||||||
ERROR_CONNECTION_ERROR = "connection_error"
|
ERROR_CONNECTION_ERROR = "cannot_connect"
|
||||||
|
|
||||||
|
|
||||||
async def async_test_client_availability(
|
async def async_test_client_availability(
|
||||||
|
@ -16,12 +16,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"auth_fail": "Username or password is incorrect.",
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||||
"connection_error": "Failed to connect to a ZoneMinder server."
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"auth_fail": "Username or password is incorrect.",
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||||
"connection_error": "Failed to connect to a ZoneMinder server."
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||||
},
|
},
|
||||||
"create_entry": { "default": "ZoneMinder server added." }
|
"create_entry": { "default": "ZoneMinder server added." }
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ async def test_import(hass: HomeAssistant) -> None:
|
|||||||
)
|
)
|
||||||
assert result
|
assert result
|
||||||
assert result["type"] == "abort"
|
assert result["type"] == "abort"
|
||||||
assert result["reason"] == "auth_fail"
|
assert result["reason"] == "invalid_auth"
|
||||||
|
|
||||||
zm_client.login.return_value = True
|
zm_client.login.return_value = True
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user