Skip to content

Commit

Permalink
Add notes to config flow about Circles & Members list update process
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbruckner committed May 22, 2024
1 parent 498fa8f commit 9eaa02b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions custom_components/life360/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,4 +496,16 @@ async def async_step_done(self, _: dict[str, Any] | None = None) -> FlowResult:
for aid in del_aids | self._authorized_aids:
async_delete_issue(self.hass, DOMAIN, aid)

old_en_aids = {aid for aid, acct in old_opts.accounts.items() if acct.enabled}
new_en_aids = {aid for aid, acct in self._opts.accounts.items() if acct.enabled}
if new_en_aids != old_en_aids:
return await self.async_step_accts_changed()
return self.async_create_entry(title="", data=self._opts.as_dict())

async def async_step_accts_changed(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Delete accounts."""
if user_input is None:
return self.async_show_form(step_id="accts_changed")
return self.async_create_entry(title="", data=self._opts.as_dict())
7 changes: 7 additions & 0 deletions custom_components/life360/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"reauth_successful": "Re-authentication was successful",
"single_instance_allowed": "Life360 supports only one configuration. Adding additional ones is not needed."
},
"create_entry": {
"default": "Tracker entities cannot be created until list of Circles & Members is retrieved from server. Due to server restrictions, this could take ten minutes or more. Monitor progress via WARNING messages in system log."
},
"error": {
"cannot_connect": "Failed to connect",
"email_not_unique": "Email address already entered",
Expand Down Expand Up @@ -153,6 +156,10 @@
"data": {
"accounts": "Select accounts to delete"
}
},
"accts_changed": {
"title": "Enabled Accounts Changed",
"description": "List of Circles & Members needs to be updated, which can take a while. Tracker entities will be created or deleted accordingly once that is done. Monitor progress via WARNING messages in system log."
}
}
},
Expand Down

0 comments on commit 9eaa02b

Please sign in to comment.