Skip to content

Commit

Permalink
Improve mDNS advertiser logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Nov 8, 2021
1 parent d27b844 commit 7c136e9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/Advertiser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export class CiaoAdvertiser extends EventEmitter implements Advertiser {
}

public updateAdvertisement(silent?: boolean): void {
this.advertisedService!.updateTxt(CiaoAdvertiser.createTxt(this.accessoryInfo, this.setupHash), silent);
let txt = CiaoAdvertiser.createTxt(this.accessoryInfo, this.setupHash);
debug("Updating txt record (txt: %o, silent: %d)", txt, silent);
this.advertisedService!.updateTxt(txt, silent);
}

public async destroy(): Promise<void> {
Expand Down Expand Up @@ -238,8 +240,11 @@ export class BonjourHAPAdvertiser extends EventEmitter implements Advertiser {
}

public updateAdvertisement(silent?: boolean): void {
let txt = CiaoAdvertiser.createTxt(this.accessoryInfo, this.setupHash)
debug("Updating txt record (txt: %o, silent: %d)", txt, silent);

if (this.advertisement) {
this.advertisement.updateTxt(CiaoAdvertiser.createTxt(this.accessoryInfo, this.setupHash), silent);
this.advertisement.updateTxt(txt, silent);
}
}

Expand Down

0 comments on commit 7c136e9

Please sign in to comment.