Skip to content

Commit 4ff8326

Browse files
committed
Added active setter
1 parent 19aa2f5 commit 4ff8326

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/accessories/fan-accessory.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export class FanAccessory extends HubspaceAccessory{
2323

2424
private configureActive(): void{
2525
this.service.getCharacteristic(this.platform.Characteristic.Active)
26-
.onGet(this.getActive.bind(this));
26+
.onGet(this.getActive.bind(this))
27+
.onSet(this.setActive.bind(this));
2728
}
2829

2930
private configureRotationSpeed(): void{
@@ -37,6 +38,10 @@ export class FanAccessory extends HubspaceAccessory{
3738
});
3839
}
3940

41+
private async setActive(value: CharacteristicValue): Promise<void>{
42+
this.deviceService.setValue(this.device.deviceId, DeviceFunction.FanPower, value);
43+
}
44+
4045
private async getActive(): Promise<CharacteristicValue>{
4146
// Try to get the value
4247
const value = await this.deviceService.getValue(this.device.deviceId, DeviceFunction.FanPower);

0 commit comments

Comments
 (0)