From 13f9c51cde5111bdef68c5b1a0625d9866ee8e58 Mon Sep 17 00:00:00 2001 From: Awawa <69086569+awawa-dev@users.noreply.github.com> Date: Thu, 26 Dec 2024 20:23:31 +0100 Subject: [PATCH] Option to disable lamps in HA wizard --- www/i18n/en.json | 2 +- www/js/wizard.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/www/i18n/en.json b/www/i18n/en.json index c64b203b8..07fa1fe7a 100644 --- a/www/i18n/en.json +++ b/www/i18n/en.json @@ -1269,5 +1269,5 @@ "select_ha_intro": "Select Home Assistant", "edt_dev_spec_constantBrightness_title": "Constant brightness", "edt_conf_reorder_displays_title": "Reorder displays", - "edt_conf_reorder_displays_expl": "Manipulate the order (permutations) of the displays until you get the correct one in multi-display mode" + "edt_conf_reorder_displays_expl": "Manipulate the order (permutations) of the displays until you get the correct one in multi-monitor mode" } diff --git a/www/js/wizard.js b/www/js/wizard.js index 0aed024ff..5d00cb3a0 100644 --- a/www/js/wizard.js +++ b/www/js/wizard.js @@ -2577,7 +2577,7 @@ function identify_ha_device(host, token, id) function createHaLedConfig(haConfig) { var lightOptions = [ - "top", "topleft", "topright", + "disabled", "top", "topleft", "topright", "bottom", "bottomleft", "bottomright", "left", "lefttop", "leftmiddle", "leftbottom", "right", "righttop", "rightmiddle", "rightbottom", @@ -2606,8 +2606,14 @@ function createHaLedConfig(haConfig) var idx_content = assignLightPos(key, defaultPosition, _haConfig.lamps[key].name); _haConfig.lamps[key].defaultPosition = defaultPosition; - ledDef.push(JSON.parse(JSON.stringify(idx_content))); + if (defaultPosition != "disabled") + { + ledDef.push(JSON.parse(JSON.stringify(idx_content))); + } } + + _haConfig.lamps = _haConfig.lamps.filter(item => item.defaultPosition != "disabled"); + window.serverConfig.leds = ledDef; requestWriteConfig({ "leds": window.serverConfig.leds }); window.serverConfig.device = _haConfig;