Configurable Polling
wwboynton opened this issue · comments
Hey there! This HA integration is really snazzy. Thank you for doing this. If you've got a donation button somewhere, I'd be happy to buy you a beer.
As noted in #12, sometimes the polling can be pretty slow. At present, the change to two minutes is okay, but being that the default polling interval for HA is thirty seconds, it still feels less responsive.
I don't mind the default being two minutes as it's probably bad practice to inundate their API with calls, but I feel as if this should be optionally configurable from the YAML when setting up the plugin.
In #20 I've done two things -- made polling interval configurable with scan_interval
in seconds, and triggered a state refresh after a service command. It was basically a rewrite (for other reasons too) so let me know if this version works for you:
https://github.com/joshjcarrier/homeassistant-litter-robot/tree/feat/data-update-coordinator