Skip to content

Commit

Permalink
Allow to call advertise on Commissioningserver multiple times (#412)
Browse files Browse the repository at this point in the history
... and just announce then
  • Loading branch information
Apollon77 authored Oct 19, 2023
1 parent 64f4485 commit e78c95d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/matter.js/src/CommissioningServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ export class CommissioningServer extends MatterNode {
throw new ImplementationError("Add the node to the Matter instance before!");
}

if (this.interactionServer !== undefined && this.deviceInstance !== undefined) {
logger.debug("Device already initialized, just advertise the instance again ...");
await this.deviceInstance.announce();
return;
}

const basicInformation = this.getRootClusterServer(BasicInformationCluster);
if (basicInformation == undefined) {
throw new ImplementationError("BasicInformationCluster needs to be set!");
Expand Down

0 comments on commit e78c95d

Please sign in to comment.