Skip to content

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

Open
@Xentox-Phil

Description

@Xentox-Phil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions