gurumitts / pylutron-caseta

Apache License 2.0
153 stars 98 forks source link

add LEAP Paging/ContinuationToken support #161

Closed jonoberheide closed 6 months ago

jonoberheide commented 7 months ago

LEAP supports a pagination mechanism when it hits limits on the number of objects returned in a particular API call. I observed this when retrieving more than 99 areas on a QSX system here: https://github.com/gurumitts/pylutron-caseta/issues/152

The response header will contain a Paging object which has a ContinuationToken that should be reflected back into a subsequent request to continue returning additional results.

This PR adds paging support to both the leap client, for manual paging invocation, and the smartbridge interface, by repeating requests until all pagination is complete and the results are merged together.

jonoberheide commented 6 months ago

Any further thoughts on the above comments or the PR, @mdonoughe @gurumitts?