openhab-android
openhab-android copied to clipboard
Slider: Send state while holding
I'm not sure if thats a good idea (because of the traffic), but I think its better, when the slider item is change, while the user is sliding.
Traffic can be reduced by using a timeout: only send update if slider is not moved (but still held down) for e.g. 100ms.
Code is done (https://github.com/mueller-ma/openhab.android/commit/a385626c3f60ad4153e5cea760e6af019667ccb8), but this causing tons of request, which is too much for e.g. the Tradfri binding. I'd close this feature request therefore.
I think you'd rather want to send after a timeout, say 100ms ... basically send if there's no value change after 100ms while still tracking. Edit: Heh, I just noticed I wrote the same thing 4 years ago already ... doesn't invalidate the point though ;-)
I added a timer, but a bit different: While sliding send updates not more frequently than every second.
https://github.com/openhab/openhab-android/compare/main...mueller-ma:openhab.android:654-slider