Apologies as I probably didn’t describe my problem properly, I’ll try to rephrase it better.
I’m upgrading a current binding I have worked on (with pending pull request) for the lgtvserial binding, and I’m mapping all those commands to a channel.
The problem is not to parse the data but on how to make a good UX experience for a user for channels that requires multiple parameters.
The problem is how to make it easy for a user to “send” the proper data to the handler for complex commands that have either multiple data fields or where the data has many criteria to take into account from a UX perspective and requires logic to generate the proper data.
The current problem is in UIs, an item is usually displayed with a basic single field to “update” in order to change the item value, which then communicate this value to the channel handler “to interpret” and make the proper api request to update the value on the device.
For instance, if you take the 3d command, the are actually 4 parameters to take into account. I can’t really have 4 parameters represented with a single UI fields. Actually I can have a list of all the possible matches maped to their internal command representation, but 3d command generate 30 different values where it would be more intuitive to have 4 select fields to select the proper values and only show/hide those that are relevant.
For instance, the 3d command data values are all dependent on the value of data1 part. Looking at the truth table on page 97, data2, data3 and data4 are only relevant when data1 is 00 or 03.
Of course I can make a single string item to map to the binding channel, and have the user implement it’s “own” logic in rules to send the proper commands, but I feel this is cumbersome for all the users who will use this binding (and potentially other bindings complex commands) that require multiple parameters.
For instance, we could have a hidden input field that represents the current value, but have it “upgraded” to interactive field, similar on how a datetime picker works, where you select the first data, and depending on the value you selected, the next “step” will adapt from that value.
If I select “3D on” (00) for data1, only data2 and data3 needs to have their value specified, and the UI component would allow a user to only set those 2 values. On the other side, if a user select “3D off” or “3D to 2D”, there is no need to specify the other 3 fields which they wouldn’t be displayed to the user either. If you choose “2D to 3D”, only the values for data4 are relevant for the user to select.
The solution I’m trying to find is to solve that problem to have multiple fields for a single item, and only show those that are relevant to the current context of “selected values” so a user would only have to select the data that makes sense to send the proper command behind the scene in order to update the thing and actuate it properly.
While I can use a webview and have such complex interaction manually created, this requires the user to make the proper integration himself instead of being provided by the binding directly.
What I’m looking for is if there is a better way than a webview for such case or if such “complex rendering system” is being worked on.