Skip to content

Commit

Permalink
Option to disable lamps in HA wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Dec 26, 2024
1 parent c24549c commit 13f9c51
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion www/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
10 changes: 8 additions & 2 deletions www/js/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 13f9c51

Please sign in to comment.