Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
validate: () => {
let device = PeripheralDevices.findOne({type: PeripheralDeviceAPI.DeviceType.PLAYOUT})
if (!device) return 'Playout-gateway not found'
let settings = device.settings || {devices: {}} as PlayoutDeviceSettings
let pharos0 = settings.devices['pharos0'] as PlayoutDeviceSettingsDevicePharos
if (!pharos0) return '"pharos0" missing'
// @ts-ignore
if (!pharos0.options) pharos0.options = {}
if (pharos0.type !== PlayoutDeviceType.PHAROS) return 'Type is not "PHAROS"'
// let cameraDevices = pharos0.options.cameraDevices
return false
},
migrate: () => {
migrate: () => {
let device = PeripheralDevices.findOne({type: PeripheralDeviceAPI.DeviceType.PLAYOUT})
if (device) {
// Set some default values:
let pharos0 = device.settings && device.settings.devices['pharos0']
if (!pharos0) {
logger.info(`Migration: Add PeripheralDevice.settings to ${device._id}: pharos0`)
PeripheralDevices.update(device._id, {$set: {
'settings.devices.pharos0': {
type: PlayoutDeviceType.PHAROS,
options: {
host: ''
}
}
}})
}
}
},
input: [{
host: ''
}
}
}})
}
}
},
input: [{
label: 'Playout-gateway: device "pharos0" not set up',
description: 'Go into the settings of the Playout-gateway and setup the device "pharos0". ($validation)',
inputType: null,
attribute: null
}]
},
ensureMapping('pharos_lights', literal({
device: PlayoutDeviceType.PHAROS,
deviceId: 'pharos0',
lookahead: LookaheadMode.NONE,
})),
ensureMapping('ptz0_zoom', literal({
device: PlayoutDeviceType.PANASONIC_PTZ,
deviceId: 'ptz0',
mappingType: MappingPanasonicPtzType.ZOOM,
lookahead: LookaheadMode.NONE,
})),
ensureMapping('ptz0_zoom_speed', literal({
device: PlayoutDeviceType.PANASONIC_PTZ,
deviceId: 'ptz0',
mappingType: MappingPanasonicPtzType.ZOOM_SPEED,
lookahead: LookaheadMode.NONE,
})),
ensureStudioConfig('ApningCameraInitialZoom', 0),