heyajohnny / cryptoinfo

Provides Home Assistant sensors for all cryptocurrencies supported by CoinGecko
GNU General Public License v3.0
46 stars 13 forks source link

feature request: poll distribution #48

Open h8hr1pzdo3rmiqv5 opened 5 days ago

h8hr1pzdo3rmiqv5 commented 5 days ago

Problem encountered: I want to track a lot of coins (say, 60), and only need a daily update. I could poll the CoinGecko API once every minute during 60 minutes, which would meet their API rates. However, the current version of CryptoInfo sends a poll for every coin at once when starting, then will poll according to update_frequency.

Possibles ways to resolve this: • poll queue: set an extension-wide variable (minutes between each poll, for example), which would serve to queue the sensor updates if the rate has been reached; • poll hour: on a sensor level, instead of update_frequency, have the possibility of setting update_schedule, which would let the user set when exactly the poll has to be sent (crontab-like, for example).

Thank you.