Created
September 23, 2019 15:23
-
-
Save voipnorm/201e04b07ef3bf7169030cdd753c73b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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