mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
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
@ -58,10 +58,10 @@ class Life360ConfigFlow(config_entries.ConfigFlow):
|
|||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Unexpected error communicating with Life360 server: %s", error
|
"Unexpected error communicating with Life360 server: %s", error
|
||||||
)
|
)
|
||||||
errors["base"] = "unexpected"
|
errors["base"] = "unknown"
|
||||||
else:
|
else:
|
||||||
if self._username in self.configured_usernames:
|
if self._username in self.configured_usernames:
|
||||||
errors["base"] = "user_already_configured"
|
errors["base"] = "already_configured"
|
||||||
else:
|
else:
|
||||||
return self.async_create_entry(
|
return self.async_create_entry(
|
||||||
title=self._username,
|
title=self._username,
|
||||||
@ -99,7 +99,7 @@ class Life360ConfigFlow(config_entries.ConfigFlow):
|
|||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Unexpected error communicating with Life360 server: %s", 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(
|
return self.async_create_entry(
|
||||||
title=f"{username} (from configuration)",
|
title=f"{username} (from configuration)",
|
||||||
data={
|
data={
|
||||||
|
@ -13,15 +13,15 @@
|
|||||||
"error": {
|
"error": {
|
||||||
"invalid_username": "Invalid username",
|
"invalid_username": "Invalid username",
|
||||||
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||||
"user_already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
|
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
|
||||||
"unexpected": "Unexpected error communicating with Life360 server"
|
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||||
},
|
},
|
||||||
"create_entry": {
|
"create_entry": {
|
||||||
"default": "To set advanced options, see [Life360 documentation]({docs_url})."
|
"default": "To set advanced options, see [Life360 documentation]({docs_url})."
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
"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…
x
Reference in New Issue
Block a user