When using the input_select.set_options there is no way to set the selected value also, which means the command will force the selected value to something first, before you can issue the command to set the right value.
At least the inout_selectvshould not react to changes in the possible options from the input_select.set_options command.
That would be weird… if the current state isn’t in the new list, how could the state represent a valid selection? The state would have to change to unknown to be consistent.
Currently, if the current state is in the new set of options, the state stays the same. If the current state isn’t in the new set of options, the state changes to the first item in the new list. So, you can set the selected value while setting the options list, by ordering your list appropriately.
In my case the with a HDMI connection the options change depending on what the signal provide from the source, so the option selected might not be on the option list when the source updates it.
The problem is that setting the wanted option to be selected first does rare make sense.
If it is a list of setups numbered from 1 to 4, then it would be strange to list number 3 as the first one.
The issue is exactly that it change to unknown and then to the first option.
When you define the input_select you have an option to set the initial and the restore value, but that possibility is not carried over to the input_select.set_options.