Commit fa5ac29 1 parent ebdf4bb commit fa5ac29 Copy full SHA for fa5ac29
File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,20 @@ for (const map of mapping) {
16
16
map [ 1 ] . sort ( ( a , b ) => {
17
17
return JSON . stringify ( a ) . localeCompare ( JSON . stringify ( b ) ) ;
18
18
} ) ;
19
+
20
+ const toDelete = [ ] ;
19
21
for ( const entry of map [ 1 ] ) {
20
22
if ( entry . type === 'light' ) {
21
23
if ( entry . discovery_payload . brightness === false ) delete entry . discovery_payload . brightness ;
22
24
if ( entry . discovery_payload . color_temp === false ) delete entry . discovery_payload . color_temp ;
23
25
if ( entry . discovery_payload . xy === false ) delete entry . discovery_payload . xy ;
24
26
if ( entry . discovery_payload . hs === false ) delete entry . discovery_payload . hs ;
27
+ } else if ( entry . object_id === 'linkquality' ) {
28
+ toDelete . push ( entry ) ;
25
29
}
26
30
}
27
31
32
+ toDelete . forEach ( ( d ) => map [ 1 ] . splice ( map [ 1 ] . indexOf ( d ) , 1 ) ) ;
33
+
28
34
console . log ( `${ map [ 0 ] } - ${ stringify ( map [ 1 ] ) } ` ) ;
29
35
}
You can’t perform that action at this time.
0 commit comments