diff --git a/.npmignore b/.npmignore index b919c84..d1f451c 100644 --- a/.npmignore +++ b/.npmignore @@ -131,6 +131,8 @@ web_modules/ .yarn/plugins .yarn/sdks .yarn/unplugged +.yarn/releases +.yarnrc.yml .pnp.* # Github templates and actions, own stuff diff --git a/src/dingzAccessory.ts b/src/dingzAccessory.ts index 0eb8831..873835e 100644 --- a/src/dingzAccessory.ts +++ b/src/dingzAccessory.ts @@ -231,8 +231,11 @@ export class DingzAccessory extends DingzDaBaseAccessory { if (this.hw.has_pir) { if (semver.lt(this.hw.fw_version, '1.2.0')) { endpoints.push('pir/single'); - } else { + } else if (semver.lt(this.hw.fw_version, '1.4.0')) { endpoints.push('pir/generic', 'pir/rise', 'pir/fall'); + } else { + // FIXES #511: Newer FW have (yet!) other endpoint for PIR callbacks + endpoints.push('pir1/rise', 'pir1/fall'); } } @@ -260,7 +263,7 @@ export class DingzAccessory extends DingzDaBaseAccessory { endpoints: endpoints, }); } else { - this.log.debug('Callback URL already set ->', callBackUrl?.url); + this.log.debug('Callback URL already set ->', callBackUrl); } }) .catch(this.handleRequestErrors.bind(this)); @@ -1495,6 +1498,12 @@ export class DingzAccessory extends DingzDaBaseAccessory { lamella: number; callback: CharacteristicSetCallback; }) { + // The API only accepts integer numbers. + // As we juggle with ° vs %, we must round + // the values for blind and lamella to the nearest integer + blind = Math.round(blind); + lamella = Math.round(lamella); + this.log.debug( `Setting WindowCovering ${id} to position ${blind} and angle ${lamella}°`, );