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
/* | |
Set timers in the AM to wake device and keep Digital Signage running | |
Timers in the PM allow device to go into standby but wake when | |
someone enters the room but digital signage only plays for short amount of time once in halwake state | |
*/ | |
import xapi from 'xapi'; | |
const Sunday = 0, Saturday = 6; | |
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
async function callHistory() { | |
const history = await this.xapi.command("CallHistory Recents", {Limit: 1, DetailLevel: "Full"}); | |
console.log(history); | |
return history; | |
} |
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
function getServiceNowIncidentIdFromURL(url){ | |
return xapi.command('HttpClient Get', { 'Header': [CONTENT_TYPE, SERVICENOW_AUTHTOKEN] , 'Url':url, 'AllowInsecureHTTPS': 'True'}); | |
} | |
function raiseTicket(message){ | |
console.log('Message raiseTicket: ' + message); | |
var messagecontent = { description: systemInfo.softwareVersion , short_description: message }; | |
xapi.command('HttpClient Post', { 'Header': [CONTENT_TYPE, SERVICENOW_AUTHTOKEN] , 'Url':MONITORING_URL, 'AllowInsecureHTTPS': 'True'} |
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
const xapi = require('xapi'); | |
const MYSITE = '<yourWebexSite>.'; | |
const domain = "webex.com"; | |
var meetingID = ''; | |
const REGEXP_WEBEX = /(webex.com)$/; | |
const REGEXP_ALPHA = /^[a-zA-Z]+$/; | |
const REGEX_WEBEXID = /^\d{9}$/; | |
const REGEXP_AT =/^.+@.+$/; | |
function onlineMeeting() { |
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
xapi.event.on('UserInterface Message Prompt Response', (event) => { | |
switch(event.FeedbackId){ | |
case 'roomfeedback_step1': | |
switch(event.OptionId){ | |
case '1': | |
xapi.command("UserInterface Message TextInput Display", { | |
Duration: 0 | |
, FeedbackId: "roomfeedback_step2_cleanliness" | |
, InputType: "SingleLine" | |
, KeyboardState: "Open" |
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
xapi.event.on('UserInterface Extensions Panel Clicked', (event) => { | |
if(event.PanelId == 'reportissue'){ | |
xapi.command("UserInterface Message Prompt Display", { | |
Title: "Report issue" | |
, Text: 'Please select what the problem area is' | |
, FeedbackId: 'roomfeedback_step1' | |
, 'Option.1':'Cleanliness' | |
, 'Option.2':'Technical issues with Audio/Video' | |
, 'Option.3': 'Other' | |
}).catch((error) => { console.error(error); }); |
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
tp.on('status', (report) => { | |
console.log(report); | |
if(report.state === 'lights'){ | |
if(report.status === 'on'){ | |
lights(true); | |
}else{ | |
lights(false); | |
} | |
}else{ |
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}); | |
} | |
}) |
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
"use strict"; | |
const KasaControl = require('kasa_control'); | |
const kasa = new KasaControl(); | |
const email = "email; | |
const password = "password"; | |
async function main() { |
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
const xapi = require('xapi'); | |
xapi.event.on('UserInterface Extensions Panel Clicked', (event) => { | |
if(event.PanelId === "chris-pmr"){ | |
xapi.command("dial", {Number: 'chris@site.webex.com'}).catch((error) => { console.error(error); }); | |
} | |
}); |
NewerOlder