diff --git a/src/views/nodes/peripheralclusternode.ts b/src/views/nodes/peripheralclusternode.ts index 30d8e79..5553817 100644 --- a/src/views/nodes/peripheralclusternode.ts +++ b/src/views/nodes/peripheralclusternode.ts @@ -39,13 +39,13 @@ export class PeripheralClusterNode extends ClusterOrRegisterBaseNode { this.parent.addChild(this); options.clusters?.forEach((clusterOptions) => { - const cluster = new PeripheralClusterNode(this, clusterOptions); - this.addChild(cluster); + // PeripheralClusterNode constructor already adding the reference as child to parent object (PeripheralClusterNode object) + new PeripheralClusterNode(this, clusterOptions); }); options.registers?.forEach((registerOptions) => { - const register = new PeripheralRegisterNode(this, registerOptions); - this.addChild(register); + // PeripheralRegisterNode constructor already adding the reference as child to parent object (PeripheralClusterNode object) + new PeripheralRegisterNode(this, registerOptions); }); } diff --git a/src/views/nodes/peripheralnode.ts b/src/views/nodes/peripheralnode.ts index f9444ca..d75ae78 100644 --- a/src/views/nodes/peripheralnode.ts +++ b/src/views/nodes/peripheralnode.ts @@ -44,13 +44,13 @@ export class PeripheralNode extends PeripheralBaseNode { this.addrRanges = []; options.clusters?.forEach((clusterOptions) => { - const cluster = new PeripheralClusterNode(this, clusterOptions); - this.addChild(cluster); + // PeripheralClusterNode constructor already adding the reference as child to parent object (PeripheralNode object) + new PeripheralClusterNode(this, clusterOptions); }); options.registers?.forEach((registerOptions) => { - const register = new PeripheralRegisterNode(this, registerOptions); - this.addChild(register); + // PeripheralRegisterNode constructor already adding the reference as child to parent object (PeripheralNode object) + new PeripheralRegisterNode(this, registerOptions); }); } diff --git a/src/views/nodes/peripheralregisternode.ts b/src/views/nodes/peripheralregisternode.ts index bba4008..d38072d 100644 --- a/src/views/nodes/peripheralregisternode.ts +++ b/src/views/nodes/peripheralregisternode.ts @@ -52,7 +52,8 @@ export class PeripheralRegisterNode extends ClusterOrRegisterBaseNode { this.parent.addChild(this); options.fields?.forEach((fieldOptions) => { - this.addChild(new PeripheralFieldNode(this, fieldOptions)); + // PeripheralFieldNode constructor already adding the reference as child to parent object (PeripheralRegisterNode object) + new PeripheralFieldNode(this, fieldOptions); }); }