OH3, OH4 - oh-button clearVariable for more than one variable

Hi All

Is there a way to clearVariable for more than one variable in an oh-button component?

slots:
  default:
    - component: oh-button
      config:
        clearVariable: selectedPartitionP
        popupClose: .modal-in

have tried (as an array - flyer?):

clearVariable: "{selectedPartitionP, Bypass}"

Have not been able to find anything by searching.

Thanks
Mark

You can try the solution poste by @JustinG here:

An array is the correct option here, you just didn’t properly set an array. The easiest way to do so is just use the yaml array fromat:

    - component: oh-button
      config:
        clearVariable:
          - selectedPartitionP
          - Bypass
        popupClose: .modal-in

But sometimes it’s easier to use an expression if the array is supposed to be dynamic. Arrays in js syntax use [...] you used {...} which is for an object (you also forgot the = to start the epxression).

    - component: oh-button
      config:
        clearVariable: =['selectedPartitionP', 'Bypass']
        popupClose: .modal-in
1 Like

Thanks Justin.
If I had thought to look fir yaml array instead of openhab aray etc i might have gotten there.
You may actually have told me before…