Closed DunkyDaMonkey closed 1 year ago
OK, cool - I'm trying something similar now. I've adjusted the polling period to 20 seconds, and hit the API after 3 polling events, so that retries occur a little sooner.
sounds like you are on to a winner, here's what my entries look like after the above code was changed, the grey bits in the bar are from restarts of home assistant when from other integrations or updates.
Let me know if I can help, if not I'll keep out of the way after all this is your baby :)
@DunkyDaMonkey , I've integrated your suggestion. I've adjusted polling to 20 seconds, with a short return of the cached data until after 3 rounds. It's a bit of a hack, would be better to keep the 1 minute polling schedule, but somehow ask for a retry sooner than scheduled.
If you have any ideas on making the command writing more resilient, then have at it!
As I said on the forum post, here's the try except code blocks that I've updated on my integration, I've only had mine on test for about an hour with this version, so potentially don't push the change.
https://github.com/pbutterworth/astralpool_chlorinator/blob/8ce920cb88768d35df3b1e4eeae9f01981769590/custom_components/astralpool_chlorinator/coordinator.py#L29
updated to:
https://github.com/pbutterworth/astralpool_chlorinator/blob/8ce920cb88768d35df3b1e4eeae9f01981769590/custom_components/astralpool_chlorinator/coordinator.py#L37-L40
updated to:
Again, take or leave what you want, or even if its inspires you on a different change. If nothing else the try/except will make your code more resilient.