nathanmarlor / foxess_modbus

FoxESS inverter integration. Connect directly to your FoxESS inverter (no cloud!) for real-time status and control.
MIT License
105 stars 14 forks source link

Allow a delay between writing a value and reading it back #543

Closed canton7 closed 5 months ago

canton7 commented 5 months ago

It seems that the inverter sometimes takes a while to correctly expose a changed value for reading, after it's written.

Give the inverter a grace period of 5 seconds, during which time we'll use the value we last wrote, rather than the value we read.

This also fixes a race where we write a value during a refresh, after the register that was written is read, but before it's notified.

Fixes: #542