cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
774
Views
0
Helpful
1
Replies

CE macro code help with xconfiguration

Karl Nurmi
Level 5
Level 5
Spoiler

Hi,

  I have set the function below and I cannot get the xapi.config.set command to work. I am doing this on a Room Kit Pro running CE 9.6 and also have tried a SX80.    

Using my catch I know the value I am sending the function is either 1 or 2.   I think I am just missing the syntax.  The following two commands work correctly from the command line: 

xconfiguration Video DefaultMainSource: 1

xconfiguration Video DefaultMainSource: 2

 

But trying in a macro with this code it fails:

 

function setCamera(number, on) {
    console.log('set camera', number, on);
    xapi.config.set('Video DefaultMainSource', {number})
      .catch(() => { console.error('Not able to set camera', number, on); });
}

 

 

What am I missing?

 

 

1 Reply 1

dstaudt
Cisco Employee
Cisco Employee

Based on the pattern for other config commands, have you tried something like:

xapi.config.set('Video', { DefaultMainSource: number})