Disable light on projector

This commit is contained in:
mmcwilliams 2019-03-13 15:28:07 -04:00
parent e47abeaaa5
commit cf6e4f9de9
1 changed files with 12 additions and 0 deletions

View File

@ -31,6 +31,11 @@ devices.profile = function (profile) {
for (let key of keys) { for (let key of keys) {
mcopy.cfg[key] = keys[key] mcopy.cfg[key] = keys[key]
} }
if (typeof p.light !== 'undefined' && p.light === false) {
light.disable();
} else {
light.enable();
}
ipcRenderer.send('profile', { profile }) ipcRenderer.send('profile', { profile })
}; };
devices.listen = function () { devices.listen = function () {
@ -45,6 +50,7 @@ devices.ready = function (event, arg) {
let opt; let opt;
let devs = []; let devs = [];
let notify = 'Connected to '; let notify = 'Connected to ';
let p;
gui.spinner(false); gui.spinner(false);
gui.overlay(false); gui.overlay(false);
for (let i in arg) { for (let i in arg) {
@ -77,6 +83,12 @@ devices.ready = function (event, arg) {
if (arg && arg.profile) { if (arg && arg.profile) {
$('#profile').val(arg.profile) $('#profile').val(arg.profile)
log.info(`Using configuration profile "${arg.profile}"`, 'DEVICES', true, true); log.info(`Using configuration profile "${arg.profile}"`, 'DEVICES', true, true);
p = mcopy.cfg.profiles[arg.profile];
if (typeof p.light !== 'undefined' && p.light === false) {
light.disable();
} else {
light.enable();
}
//devices.profile(arg.profile) //devices.profile(arg.profile)
} }
if (arg.projector_second) { if (arg.projector_second) {