@@ -2577,7 +2577,7 @@ function identify_ha_device(host, token, id)
25772577function createHaLedConfig ( haConfig )
25782578{
25792579 var lightOptions = [
2580- "top" , "topleft" , "topright" ,
2580+ "disabled" , " top", "topleft" , "topright" ,
25812581 "bottom" , "bottomleft" , "bottomright" ,
25822582 "left" , "lefttop" , "leftmiddle" , "leftbottom" ,
25832583 "right" , "righttop" , "rightmiddle" , "rightbottom" ,
@@ -2606,8 +2606,14 @@ function createHaLedConfig(haConfig)
26062606 var idx_content = assignLightPos ( key , defaultPosition , _haConfig . lamps [ key ] . name ) ;
26072607
26082608 _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+ }
26102613 }
2614+
2615+ _haConfig . lamps = _haConfig . lamps . filter ( item => item . defaultPosition != "disabled" ) ;
2616+
26112617 window . serverConfig . leds = ledDef ;
26122618 requestWriteConfig ( { "leds" : window . serverConfig . leds } ) ;
26132619 window . serverConfig . device = _haConfig ;
0 commit comments