Use common strings in life360 config flow (#42375)
* Use common strings for life360 config flow * Address feedback comments * Keep two space indentation * Fix indentation hopefully
This commit is contained in:
parent
989ab5029a
commit
4e28ae8e3a
2 changed files with 6 additions and 6 deletions
|
@ -58,10 +58,10 @@ class Life360ConfigFlow(config_entries.ConfigFlow):
|
|||
_LOGGER.error(
|
||||
"Unexpected error communicating with Life360 server: %s", error
|
||||
)
|
||||
errors["base"] = "unexpected"
|
||||
errors["base"] = "unknown"
|
||||
else:
|
||||
if self._username in self.configured_usernames:
|
||||
errors["base"] = "user_already_configured"
|
||||
errors["base"] = "already_configured"
|
||||
else:
|
||||
return self.async_create_entry(
|
||||
title=self._username,
|
||||
|
@ -99,7 +99,7 @@ class Life360ConfigFlow(config_entries.ConfigFlow):
|
|||
_LOGGER.error(
|
||||
"Unexpected error communicating with Life360 server: %s", error
|
||||
)
|
||||
return self.async_abort(reason="unexpected")
|
||||
return self.async_abort(reason="unknown")
|
||||
return self.async_create_entry(
|
||||
title=f"{username} (from configuration)",
|
||||
data={
|
||||
|
|
|
@ -13,15 +13,15 @@
|
|||
"error": {
|
||||
"invalid_username": "Invalid username",
|
||||
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||
"user_already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
|
||||
"unexpected": "Unexpected error communicating with Life360 server"
|
||||
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
|
||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||
},
|
||||
"create_entry": {
|
||||
"default": "To set advanced options, see [Life360 documentation]({docs_url})."
|
||||
},
|
||||
"abort": {
|
||||
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||
"user_already_configured": "[%key:common::config_flow::abort::already_configured_account%]"
|
||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue