HestiaPi / hestia-touch-one-ui

ONE UI files shown on the touch LCD
GNU General Public License v3.0
5 stars 7 forks source link

Target temperature bouncing #11

Closed jaythomas closed 4 years ago

jaythomas commented 4 years ago

I'm surprised I haven't seen anyone mention this issue yet, but if you tap to change the temperature multiple times in quick succession, openhab will receive the temperature change from the first request and relay it back to the frontend and cause the temperature to bounce back.

For example:

In some cases I've even seen it bounce between 71<->72 stuck in an infinite loop.

@gulliverrr I'd like to hear your thoughts on how to handle this, but two solutions I see that could fix this:

  1. Implement a debounce on the decrement/increment functions so that tapping the screen many times in a row only sends one event to OpenHab
  2. On the OpenHab side when sending the event to change the temperature, also send an ID of the client the message originated from. If the client sees the ID of origin is itself it knows to ignore the message.
gulliverrr commented 4 years ago

I'm inclined to go for 1. A simple timer (1sec?) to delay dispatching updates I believe would be long enough to stop bouncing.