Open tacvideo opened 7 months ago
Hi,
This is not an error from this module but from the instance wrapper (see here).
They added the instance wrapper to support legacy modules from Companion v.2 in v.3. As such, this code wasn't there when I wrote the module. You can see here the Regex they use to validate variable 'ids', which was added two years ago:
const idCheckRegex = /^([a-zA-Z0-9-_\.]+)$/
This only allows alphanumerics and -
, _
and .
. However, that's a breaking change from version 2 to version 3 of Companion, as previously, the variable names were much more permissive. See here, where I check for invalid ID characters ($
, :
, (
, )
and whitespace characters which were used internally in v.2 of Companion) and replaces them:
/**
* Detects unsafe characters for variable names.
*/
button.REGEX_SAFEVARIABLE = /[$:()\s)]/g;
One of the nice features my module used to add is a set of variables for each button that you could use as substitutions in your definitions. However, it named these variables as shown in your list above (I've reformatted for you for clarity).
You could expose the 'by name' variables by avoiding new lines (mapped to ~
by TLC) and other newly invalid characters (like &
), halving the reported errors. However, my existing code uses [
, :
and ,
to distinguish TLC Page and Position in the 'by position' variables, so there is no way of avoiding that error or exposing those variables.
The changes added in the legacy wrapper for Companion v.3 appear to have broken the automatic variable functionality. It is unclear how I would efficiently support the same functionality in v.3. For now, the side effect is the error log you're seeing.
Sadly, this is just one of the many reasons that updating this module from v.2 to v.3 of Companion is far from trivial and is not something I plan on undertaking in the near future (if ever), as you can read here.
In the meantime, I will leave this case open as it identifies an incompatibility area if anyone undertakes an upgrade in the future. Alternatively, you could raise this to the Companion developers as an area where their legacy wrapper breaks compatibility for version 2 modules. Sadly, I expect they made the IDs more restrictive by necessity and are unlikely to loosen the restriction.
Thanks for that detailed explanation, it’s been a decade or so since I wrote any kind of code, but I get the gist of the problem!
But essentially, is this something I should be concerned about?
What are you using now instead of TLC? I really like how we can see the status of a TLC button and that it’s not MIDI based, but I probably need to find something more stable…
But essentially, is this something I should be concerned about?
Not really. If you don't use the variable functionality, then it doesn't matter it's not working.
What are you using now instead of TLC? I really like how we can see the status of a TLC button and that it’s not MIDI based, but I probably need to find something more stable…
The way I get Companion to synchronise the colours, text and states of buttons with TLC isn't really something Companion was designed for, and it is what makes this module fun.
Sadly, it's also why migrating to the new version of Companion is non-trivial.
I was running live streams, sound, cameras, presentations/overlays and lights for my church through the pandemic and so I needed something that could control all of those devices. I set up Companion to integrate to all of those and that allowed me to control everything on my own using two streamdecks.
I took a break after the pandemic, and sadly they 'rearranged everything' whilst I wasn't doing it. The thought of fixing everything again is too much (all those systems are now not working) so I have stopped volunteering. Now none of the lights or cameras are used. So I've moved on to other projects, mostly around home automation.
Sadly, that's the nature of Open Source software. I try to be helpful to anyone using the module and I would make code tweaks happily, but Bitfocus decided to require a non-trivial upgrade before accepting further pull requests. Realistically, it requires a full rewrite and it's not clear I can replicate all the existing functionality.
Companion: 3.2.2 Host Mac: 14.4 Every time this Instance is enabled this error is reported in the logs, listing what looks like every listed button/scene in TheLightingController, any idea why?