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

Allow setting defaultValues and if the variable should be persisted #100

Open
Xentox-Phil opened this issue Oct 27, 2024 · 0 comments
Open

Comments

@Xentox-Phil
Copy link

Xentox-Phil commented Oct 27, 2024

https://bitfocus.github.io/companion-module-base/interfaces/CompanionVariableDefinition.html

i would love to pass in here what the default value is so if the module initialises it takes this value and if its then defined it does not take the default value anymore... maybe this can be also driven by the persist option. If it should persist it will take the value from before when the plugin was started... and if it should not persist it takes the default value. And when this is already a thing i would love to know how to persist values.

{ variableId: 'activeConnections', name: 'The count of active connections', default: 0 }

just a small example.

I know I can program this behaviour myself but I would love that the library gives you this out of the box.

Intended behaviour on definition:

see if the variable is undefined if yes set it to the default value...

Furthermore i just found out when a variable gets defined and has no value its a string "" why is it not undefined? I don't get that either

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant