Support `$(this:surface_id)` in logic conditions
Is this a feature relevant to companion itself, and not a specific module?
- [x] I believe this to be a feature for companion, and is not specific to a module
Is there an existing issue for this?
- [x] I have searched for similiar existing issues
Describe the feature
I'd love to see the ability to add more logic in the logic action in relation to streamdeck surfaces. Companion is already pulling the surface ID and allowing use in some places but not everywhere. These's a few pages that I've made that get used by many different positions, but they can't share a page as there "home" page has different levels of access to other pages. The pages ended up being made multiple times so the home button takes them to their respective home page.
If the logic command was exposed to surface IDs, I could then share this page across multiple positions and build a logic, that if it is this streamdeck, then it will "set to page" (surface ID, which already exist), back to the right page. This would then give me the ability to share pages without having to duplicate them, remember to edit all of them or rexport/import if a change is made.
Usecases
No response
The challenge here is that partly for legacy reasons, we execute feedbacks once and cache their results until either they report themselves as having changed, or one of the input values having changed.
This is largely because until recently feedbacks were used just for styling, and not for execution logic. Even still, we dont want to have to wait for a module to 'execute' a feedback as part of action logic, that will slow things down a lot.
So if a feedback is using the $(this:surface_id), we would have to discard all the rules/structure about how they behave and are cached and do it differently. This wouldn't be too bad to do for some of the internal feedbacks, which I suspect will be enough.
One workaround for this is to use a sequential action group that begins by saving $(this:surface_id) to a local variable, waits 10ms, then checks your condition against that local variable.
Also, I presume you aren't able to just set each surface's Startup Page to be unique and have the home button's "set to page" action go to the current surface's startup page.
One workaround for this is to use a sequential action group that begins by saving $(this:surface_id) to a local variable, waits 10ms, then checks your condition against that local variable.
I almost did suggest that, but then thought about the potential for race conditions, especially with multiple users that would end up with each of them on each others pages. Perhaps a low risk, but it is definitely there