pnbruckner / ha-life360

A Home Assistant integration for Life360.
32 stars 4 forks source link

Overhaul implementation #14

Closed pnbruckner closed 1 month ago

pnbruckner commented 2 months ago

The Life360 server API seems to have changed again and appears to be usable. The life360 package has been updated accordingly. This PR moves to that new version.

Also, the integration is being reorganized significantly. The most major change is moving from a config entry per account to only one config entry with all accounts. Also, the accounts are made options so they can be easily updated (added, deleted, or modified.) This allows a much simpler data update coordinator implementation.

Another change is due to one of the apparent changes in the API. It seems most requests can be made very often, but the same is not the case for requesting an account's Circles. It seems this can not be done more than once every 10 minutes, and even then sometimes it results in an HTTP error 429, too many requests. When this happens it does return a retry-after header, so the implementation will use that to retry. Ultimately, though, the list of Circle IDs will need to be stored and then updated periodically, like once per hour.

Fixes #12