@@ -2577,7 +2577,7 @@ function identify_ha_device(host, token, id)
2577
2577
function createHaLedConfig ( haConfig )
2578
2578
{
2579
2579
var lightOptions = [
2580
- "top" , "topleft" , "topright" ,
2580
+ "disabled" , " top", "topleft" , "topright" ,
2581
2581
"bottom" , "bottomleft" , "bottomright" ,
2582
2582
"left" , "lefttop" , "leftmiddle" , "leftbottom" ,
2583
2583
"right" , "righttop" , "rightmiddle" , "rightbottom" ,
@@ -2606,8 +2606,14 @@ function createHaLedConfig(haConfig)
2606
2606
var idx_content = assignLightPos ( key , defaultPosition , _haConfig . lamps [ key ] . name ) ;
2607
2607
2608
2608
_haConfig . lamps [ key ] . defaultPosition = defaultPosition ;
2609
- ledDef . push ( JSON . parse ( JSON . stringify ( idx_content ) ) ) ;
2609
+ if ( defaultPosition != "disabled" )
2610
+ {
2611
+ ledDef . push ( JSON . parse ( JSON . stringify ( idx_content ) ) ) ;
2612
+ }
2610
2613
}
2614
+
2615
+ _haConfig . lamps = _haConfig . lamps . filter ( item => item . defaultPosition != "disabled" ) ;
2616
+
2611
2617
window . serverConfig . leds = ledDef ;
2612
2618
requestWriteConfig ( { "leds" : window . serverConfig . leds } ) ;
2613
2619
window . serverConfig . device = _haConfig ;
0 commit comments