Skip to content

Commit

Permalink
fix(dingz): 🐛 further fixes for upcoming FW 1.4.x changes
Browse files Browse the repository at this point in the history
- fixes #511
  • Loading branch information
johannrichard committed Oct 24, 2022
1 parent b7588ee commit ea3eeab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dingzAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export class DingzAccessory extends DingzDaBaseAccessory {
.then((callBackUrl) => {
// Set the callback URL
const endpoints = ['generic'];
const platformCallbackUrl = this.platform.getCallbackUrl();

// Add PIR callbacks, depending on dingz Firmware version
if (this.hw.has_pir) {
Expand All @@ -246,9 +247,9 @@ export class DingzAccessory extends DingzDaBaseAccessory {
} else if (
// FIXME: because of #511
(semver.lt(this.hw.fw_version, '1.4.0') &&
!callBackUrl?.url?.includes(this.platform.getCallbackUrl())) ||
!callBackUrl?.url?.includes(platformCallbackUrl)) ||
(semver.gte(this.hw.fw_version, '1.4.0') &&
!callBackUrl?.generic?.includes(this.platform.getCallbackUrl()))
!callBackUrl?.generic?.includes(platformCallbackUrl))
) {
this.log.warn('Update existing callback URL ->', callBackUrl);

Expand Down

0 comments on commit ea3eeab

Please sign in to comment.