Skip to content

Commit fa5ac29

Browse files
committed
Update dumpHomeAssistantMapping.js
1 parent ebdf4bb commit fa5ac29

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/dumpHomeAssistantMapping.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ for (const map of mapping) {
1616
map[1].sort((a, b) => {
1717
return JSON.stringify(a).localeCompare(JSON.stringify(b));
1818
});
19+
20+
const toDelete = [];
1921
for (const entry of map[1]) {
2022
if (entry.type === 'light') {
2123
if (entry.discovery_payload.brightness === false) delete entry.discovery_payload.brightness;
2224
if (entry.discovery_payload.color_temp === false) delete entry.discovery_payload.color_temp;
2325
if (entry.discovery_payload.xy === false) delete entry.discovery_payload.xy;
2426
if (entry.discovery_payload.hs === false) delete entry.discovery_payload.hs;
27+
} else if (entry.object_id === 'linkquality') {
28+
toDelete.push(entry);
2529
}
2630
}
2731

32+
toDelete.forEach((d) => map[1].splice(map[1].indexOf(d), 1));
33+
2834
console.log(`${map[0]} - ${stringify(map[1])}`);
2935
}

0 commit comments

Comments
 (0)