Skip to content

Commit

Permalink
Set ciao as default advertiser (#1066)
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker authored Jul 21, 2024
2 parents c3591d5 + 178a066 commit 769298f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to `hap-nodejs` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/).

## Next Release

### Changes

- Set `Ciao` as the default Advertiser

## v1.0.0 (2024-07-10)

### Breaking Changes
Expand Down
8 changes: 4 additions & 4 deletions src/lib/Accessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1186,19 +1186,19 @@ export class Accessory extends EventEmitter {
// create our Advertiser which broadcasts our presence over mdns
const parsed = Accessory.parseBindOption(info);

let selectedAdvertiser = info.advertiser ?? MDNSAdvertiser.BONJOUR;
info.advertiser ??= MDNSAdvertiser.CIAO;
if (
(info.advertiser === MDNSAdvertiser.AVAHI && !await AvahiAdvertiser.isAvailable()) ||
(info.advertiser === MDNSAdvertiser.RESOLVED && !await ResolvedAdvertiser.isAvailable())
) {
console.error(
`[${this.displayName}] The selected advertiser, "${info.advertiser}", isn't available on this platform. ` +
`Reverting to "${MDNSAdvertiser.BONJOUR}"`,
`Reverting to "${MDNSAdvertiser.CIAO}"`,
);
selectedAdvertiser = MDNSAdvertiser.BONJOUR;
info.advertiser = MDNSAdvertiser.CIAO;
}

switch (selectedAdvertiser) {
switch (info.advertiser) {
case MDNSAdvertiser.CIAO:
this._advertiser = new CiaoAdvertiser(this._accessoryInfo, {
interface: parsed.advertiserAddress,
Expand Down

0 comments on commit 769298f

Please sign in to comment.