mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Use references in Neato translation strings (#41009)
* Replace unexpected_error with unknown key in Neato * Replace string with reference * Revert the specific language json files back to unexpected_error * Use reference for already_configured * Change invalid_credentials to invalid_auth key * Use reference for invalid_auth * Use invalid_auth in the neato test * Replace abort.invalid_credentials with invalid_auth
This commit is contained in:
parent
3a266fa116
commit
414633a129
@ -105,8 +105,8 @@ class NeatoConfigFlow(config_entries.ConfigFlow, domain=NEATO_DOMAIN):
|
|||||||
try:
|
try:
|
||||||
Account(username, password, this_vendor)
|
Account(username, password, this_vendor)
|
||||||
except NeatoLoginException:
|
except NeatoLoginException:
|
||||||
return "invalid_credentials"
|
return "invalid_auth"
|
||||||
except NeatoRobotException:
|
except NeatoRobotException:
|
||||||
return "unexpected_error"
|
return "unknown"
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
@ -12,15 +12,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"invalid_credentials": "Invalid credentials",
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||||
"unexpected_error": "Unexpected error"
|
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||||
},
|
},
|
||||||
"create_entry": {
|
"create_entry": {
|
||||||
"default": "See [Neato documentation]({docs_url})."
|
"default": "See [Neato documentation]({docs_url})."
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "Already configured",
|
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
|
||||||
"invalid_credentials": "Invalid credentials"
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -118,7 +118,7 @@ async def test_abort_on_invalid_credentials(hass):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
assert result["errors"] == {"base": "invalid_credentials"}
|
assert result["errors"] == {"base": "invalid_auth"}
|
||||||
|
|
||||||
result = await flow.async_step_import(
|
result = await flow.async_step_import(
|
||||||
{
|
{
|
||||||
@ -128,7 +128,7 @@ async def test_abort_on_invalid_credentials(hass):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||||
assert result["reason"] == "invalid_credentials"
|
assert result["reason"] == "invalid_auth"
|
||||||
|
|
||||||
|
|
||||||
async def test_abort_on_unexpected_error(hass):
|
async def test_abort_on_unexpected_error(hass):
|
||||||
@ -147,7 +147,7 @@ async def test_abort_on_unexpected_error(hass):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
assert result["errors"] == {"base": "unexpected_error"}
|
assert result["errors"] == {"base": "unknown"}
|
||||||
|
|
||||||
result = await flow.async_step_import(
|
result = await flow.async_step_import(
|
||||||
{
|
{
|
||||||
@ -157,4 +157,4 @@ async def test_abort_on_unexpected_error(hass):
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||||
assert result["reason"] == "unexpected_error"
|
assert result["reason"] == "unknown"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user