diff --git a/src/accessories/fan-accessory.ts b/src/accessories/fan-accessory.ts index 2cc5173..08e4dae 100644 --- a/src/accessories/fan-accessory.ts +++ b/src/accessories/fan-accessory.ts @@ -23,7 +23,8 @@ export class FanAccessory extends HubspaceAccessory{ private configureActive(): void{ this.service.getCharacteristic(this.platform.Characteristic.Active) - .onGet(this.getActive.bind(this)); + .onGet(this.getActive.bind(this)) + .onSet(this.setActive.bind(this)); } private configureRotationSpeed(): void{ @@ -37,6 +38,10 @@ export class FanAccessory extends HubspaceAccessory{ }); } + private async setActive(value: CharacteristicValue): Promise{ + this.deviceService.setValue(this.device.deviceId, DeviceFunction.FanPower, value); + } + private async getActive(): Promise{ // Try to get the value const value = await this.deviceService.getValue(this.device.deviceId, DeviceFunction.FanPower);