feat: Using setValue to update UI immediately for WebAPI devices #2040
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements
setValuefunctionality for WebAPI devices, enabling immediate UI updates when values are changed programmatically via WebSocket or scripts, bypassing the polling interval.Problem
WebAPI devices did not support
setValue. When updating tag values programmatically through WebSocket commands or scripts, the UI would not reflect changes until the next polling cycle, causing delays of several seconds depending on the polling interval.This made real-time interactions (e.g., script runs for calling external actions) feel unresponsive like in the case of issue #1590
Use Case Example
A WebAPI device is configured with a polling interval (e.g., 5 seconds) to regularly fetch data. Additionally, a WebSocket connection is established with a script (similar to the WebSocket integration described in the FUXA wiki HowTo Websockets) that receives real-time push notifications from the WebAPI server when values change.
How it works:
setValue()is called → FUXA processes the update and immediately refreshes the UIBenefits of the possibility of this hybrid approach:
Related Issues
Fixes #1590