Skip to content

Commit

Permalink
Set HAP properties for fan speed handling
Browse files Browse the repository at this point in the history
  • Loading branch information
datibbaw committed Apr 24, 2023
1 parent 9ec337e commit faff207
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions accessories/fan.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,15 @@ class FanAccessory extends SwitchAccessory {
}
});

// Add HAP properties for improved accessory representation in Homekit
if (config.stepSize > 1) {
this.getCharacteristic(type).setProps({
minStep: config.stepSize,
minValue: 0,
maxValue: 100
});
}

if (config.showRotationDirection) {
this.serviceManager.addToggleCharacteristic({
name: 'rotationDirection',
Expand Down

0 comments on commit faff207

Please sign in to comment.