From cf6e4f9de9a54666aa1f012aa60a57fc94514a7f Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Wed, 13 Mar 2019 15:28:07 -0400 Subject: [PATCH] Disable light on projector --- app/lib/ui/devices.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/lib/ui/devices.js b/app/lib/ui/devices.js index 50ef34a..b198862 100644 --- a/app/lib/ui/devices.js +++ b/app/lib/ui/devices.js @@ -31,6 +31,11 @@ devices.profile = function (profile) { for (let key of keys) { mcopy.cfg[key] = keys[key] } + if (typeof p.light !== 'undefined' && p.light === false) { + light.disable(); + } else { + light.enable(); + } ipcRenderer.send('profile', { profile }) }; devices.listen = function () { @@ -45,6 +50,7 @@ devices.ready = function (event, arg) { let opt; let devs = []; let notify = 'Connected to '; + let p; gui.spinner(false); gui.overlay(false); for (let i in arg) { @@ -77,6 +83,12 @@ devices.ready = function (event, arg) { if (arg && arg.profile) { $('#profile').val(arg.profile) 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) } if (arg.projector_second) {