Skip to content

Commit

Permalink
fix(accessory): 🐛 implements fix for tilt angle
Browse files Browse the repository at this point in the history
fix the issues in #555 with tilt angle,
only convert `°` to `%` in case values is set by HomeKit

Fixes #555
  • Loading branch information
johannrichard committed Jan 29, 2023
1 parent a4d1383 commit 2e1b7a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dingzAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ export class DingzAccessory extends DingzDaBaseAccessory {
await this.setWindowCovering({
id: id,
blind: position as number,
lamella: (windowCovering.lamella / 90) * 100, // FIXES #419, we must convert ° to %
lamella: windowCovering.lamella, // FIXES #419, we must convert ° to %
callback: callback,
});
}
Expand Down Expand Up @@ -1518,7 +1518,7 @@ export class DingzAccessory extends DingzDaBaseAccessory {
lamella = Math.round(lamella);

this.log.debug(
`Setting WindowCovering ${id} to position ${blind} and angle ${lamella}°`,
`Setting WindowCovering ${id} to position ${blind} and ${lamella}% tilt position`,
);
// The API says the parameters can be omitted. This is not true
// {{ip}}/api/v1/shade/0?blind=<value>&lamella=<value>
Expand Down

0 comments on commit 2e1b7a3

Please # to comment.