i am developing a ui to control a device. The device is sending me by mqtt every sec the current values saved in its registers. I am showing these values on the ui, but i need to allow the user to change them and save the new values into the device. So for example i am showing a temperature but i want my user to change the value and save it back. Now a problem occurs:
- if i show the current value on a numeric input control, when the user is choosing his value, the input value is reset before his submit. unusable, because the current value is sent every second.
- if i used an rbe node, to stop updating the input control, i would have on the ui the value selected by the user only, but not what is actually stored into the device.
I have thought three solutions to tackle these problems. i would like to know if they can be considered good practice or if some of you had a similar experience and can suggest me new ideas or hints.
- showing only the current value on the ui and editing the values on a modal dialog, then submit them to the device. The user can check if his values are really saved waiting for the ui update. minus: a lot of additional code, to manage the dialog and the form there in a template node.
- a trigger node, with a timeout. the ui will show the user chosen value for a certain amount of time then it resets back to show the current value. minus: dirty solution
- showing the values in a text node, and updating them using input controls which are not related to the current values. minus: a lot of values flooding the ui, and duplication for custom visualizations.
every comment and idea is appreciated.