jhansche / ha-birdbuddy

Home Assistant integration for Bird Buddy smart bird feeders
MIT License
41 stars 2 forks source link

Discover older feed items #59

Open jhansche opened 1 year ago

jhansche commented 1 year ago

56 by @sankeerthb highlights that even once the automation is working, it won't discover older feed items (beyond the first page of items). This is normally fine when the integration is polling every 10 min, but for the first use of the integration, it might have more postcards farther back in the feed that need to be discovered.

We can store a flag (boolean or oldest feed item date) once we've traversed the feed back to the beginning, and do that on the first poll after installing, if it hasn't been done yet. Or go back one additional page for each polling internal until reaching the oldest page, if we're concerned about hammering the API.