Skip to content

Instantly share code, notes, and snippets.

@voipnorm
Created September 23, 2019 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voipnorm/201e04b07ef3bf7169030cdd753c73b5 to your computer and use it in GitHub Desktop.
Save voipnorm/201e04b07ef3bf7169030cdd753c73b5 to your computer and use it in GitHub Desktop.
monitorWidget() {
this.xapi.event.on('UserInterface Extensions Widget Action', (event) => {
const msg = `id=${event.WidgetId} / type=${event.Type} / value=${event.Value}`;
console.log(msg);
if(event.WidgetId === 'office'){
return this.emit('status', {state: 'lights', status: event.Value});
}else{
return this.emit('status', {state: 'dimmer', status: event.Value});
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment