Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit calls to service #331

Open
welshcoder opened this issue Mar 9, 2024 · 0 comments
Open

Limit calls to service #331

welshcoder opened this issue Mar 9, 2024 · 0 comments

Comments

@welshcoder
Copy link

First of all - excellent feature for HA! I've found your add-on really helpful in getting around some limitations in HA.

Is your feature request related to a problem? Please describe.
No, not that I'm aware of.

Describe the solution you'd like
The ability to limit the number of calls to a service made within a certain amount of time. The problem I have is that I use an API service that has a rather low daily call limit. Normally, this is fine under normal circumstances. However, when developing or editing multiscrape sensors, the act of reloading the configuration calls all the services, clocking up the calls to each API service, including the one with the low daily allowance. It would be useful if there was a setting that allows you to configure the minimum time between calls to the URL, and that any attempt to update the sensor during this call lock-out time will simply be ignored. If this could persist across HA restarts too, even better!

Describe alternatives you've considered
Remembering to comment out the API key of the low call allowance service before starting to develop other multiscrape sensors (or anything that might trigger a multiscrape refresh)!

Under normal circumstances, I've added a button to manually call for the update of the low call allowance service and set the "scan_interval" setting to a very large value. It would be good if the call lock-out time would apply to those manual refresh calls too.

Additional context
This is another use case for this proposed feature: I use the data from the low call allowance service on an electronic display. The manual updating by pressing a button is a bit clunky, and it would be good if the data was refreshed when the page was selected for a rather slicker display. I wouldn't want to refresh the data every time the page is selected, but rather I would like it to limit the time between calls to be, say, 30 mins or more, regardless of how many times the page is selected in that time. I know it is possible to effectively achieve this by other means, but a single configuration option as described above would make the implementation so much easier!

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant