-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd09413
commit 40fd4c5
Showing
2 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
const node = driver.controller.nodes.get(50) | ||
const clonedNode = driver.controller.nodes.get(51) | ||
// replace `undefined` with the id of the node you want to clone | ||
const node = driver.controller.nodes.get(undefined); | ||
|
||
// list here all the nodes ids you want to copy configuration to | ||
const clonedNodes = [].map(n => driver.controller.nodes.get(n)); | ||
|
||
const values = node.getDefinedValueIDs() | ||
|
||
for(const v of values) { | ||
// clone only configuration CC values | ||
if(v.commandClass === 112) { | ||
const value = node.getValue(v) | ||
await clonedNode.setValue(v, value) | ||
} | ||
for (const clonedNode of clonedNodes) { | ||
for(const v of values) { | ||
if(v.commandClass === 112) { | ||
await clonedNode.setValue(v, | ||
node.getValue(v) | ||
) | ||
} | ||
} | ||
} |