Skip to content

Commit

Permalink
fix(dingz): set pir callback only if pir present
Browse files Browse the repository at this point in the history
- fixes #16
  • Loading branch information
johannrichard committed Jun 15, 2020
1 parent 0b05d3a commit a3b3b0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dingzAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ export class DingzDaAccessory extends EventEmitter {
callBackUrl,
);
// Set the callback URL (Override!)
const endpoints = this.dingzDeviceInfo.has_pir
? ['generic', 'pir/single']
: ['generic'];
this.platform.setButtonCallbackUrl({
baseUrl: this.baseUrl,
token: this.device.token,
oldUrl: callBackUrl.url,
// FIXME
endpoints: ['generic', 'pir/single'],
endpoints: endpoints,
});
} else {
this.platform.log.debug(
Expand Down

0 comments on commit a3b3b0b

Please sign in to comment.