Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next / Previous dropdown selection via action #2848

Open
2 tasks done
phillipivan opened this issue Apr 27, 2024 · 2 comments
Open
2 tasks done

Next / Previous dropdown selection via action #2848

phillipivan opened this issue Apr 27, 2024 · 2 comments
Labels
area/internal Related to an internal action or function of Companion. Enhancement New feature or request Solution needed Needs a solution on how to solve it

Comments

@phillipivan
Copy link

Is this a feature relevant to companion itself, and not a module?

  • I believe this to be a feature for companion, not a module

Is there an existing issue for this?

  • I have searched the existing issues

Describe the feature

I would like internal actions to select the next or previous item from a dropdown in an action or feedback. This would be especially useful with the rotary actions.
For this to be most useable, the label field of the dropdown would need to be exposed as a variable so it can be displayed so the operator can see currently selected item.

I am not sure how this might work with multidrop option fields.

Sometimes this kind of action can be achieved with variables, especially if the input is a sequential number element, however for non sequential lists or strings any user side solution gets much more complicated. Even more so if the elements of the dropdown are determined at run time (and may even change during operation).

This can be implemented inside a module but requires some specific work for every element it is to apply to which adds a lot of boiler plate code.

Usecases

Selecting a source from a list for router control. Changing mode of a device, selecting a preset to recall etc. Allowing much more space efficient programming that a 'button per option' approach, and allows for the option list to change during runtime without needing a button reconfiguration / addition.

@dnmeid
Copy link
Member

dnmeid commented Apr 27, 2024

This relates to #2345.
With the changes there you could switch a dropdown to an expression and then e.g. use its values by an index. That means you just have to count up/down a number and get the corresponding option value.
Would the changes of 2345 fullfill your needs? Then please close this issue, otherwise please clarify what else could be of interest.

@phillipivan
Copy link
Author

I believe #2345 would get some but not all of the way there.

The critical element that I believe is missing, is a practical way to return the label element of a drop down for displaying on the button, so the user knows which element is selected.

@Julusian Julusian added Enhancement New feature or request Solution needed Needs a solution on how to solve it area/internal Related to an internal action or function of Companion. labels May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/internal Related to an internal action or function of Companion. Enhancement New feature or request Solution needed Needs a solution on how to solve it
Projects
None yet
Development

No branches or pull requests

3 participants