mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix incorrect error strings in triggercmd (#128450)
This commit is contained in:
parent
0e7297873c
commit
5d079aacd6
@ -56,7 +56,7 @@ class TriggerCMDConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
except InvalidToken:
|
except InvalidToken:
|
||||||
errors[CONF_TOKEN] = "invalid_token"
|
errors[CONF_TOKEN] = "invalid_token"
|
||||||
except TRIGGERcmdConnectionError:
|
except TRIGGERcmdConnectionError:
|
||||||
errors["base"] = "connection_error"
|
errors["base"] = "cannot_connect"
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception: # pylint: disable=broad-except
|
||||||
_LOGGER.exception("Unexpected exception")
|
_LOGGER.exception("Unexpected exception")
|
||||||
errors["base"] = "unknown"
|
errors["base"] = "unknown"
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"error": {
|
"error": {
|
||||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
||||||
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||||
|
"invalid_token": "Invalid token",
|
||||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
|
@ -140,7 +140,7 @@ async def test_config_flow_connection_error(hass: HomeAssistant) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert result["errors"] == {
|
assert result["errors"] == {
|
||||||
"base": "connection_error",
|
"base": "cannot_connect",
|
||||||
}
|
}
|
||||||
assert result["type"] is FlowResultType.FORM
|
assert result["type"] is FlowResultType.FORM
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user