johnanthonyeletto / homebridge-windmill-ac

Apache License 2.0
8 stars 1 forks source link

Debounce requests to the Windmill API #2

Open johnanthonyeletto opened 1 year ago

johnanthonyeletto commented 1 year ago

Is your feature request related to a problem? Please describe:

"Set" requests when done in rapid succession can lead to a possible race condition depending on the response speed of the API. For example, changing the temperature or mode multiple times leads to multiple requests and can resolve out of order.

Describe the solution you'd like:

When a "set" request is handled, it is debounced which means that only the last request in a certain time period will be the one that executes.

Describe alternatives you've considered:

We can potentially create a request queue where requests are always done in order.

Additional context: