Hi guys,
I have a working custom sensor that polls an API every 10 seconds (or at a user-defined interval through the config yaml). I have had a surprising amount of positive feedback. My ask stems from the #1 feature request which is to make the component less chatty. I would like the polling interval to be dynamically set based on the last returned API data.
For example, at initialization, it polls the API every 10 seconds. If the API returns “abc”, it starts polling every 30 seconds. If the API returns “def”, it starts polling every second. If the API returns “xyz”, it starts polling every 10 seconds, etc.
How would I accomplish that?
You can find the repo here.
Thanks!