homebridge-flair
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -1,2 +0,2 @@ | ||
import type { CharacteristicGetCallback, CharacteristicValue, PlatformAccessory } from 'homebridge'; | ||
import type { CharacteristicValue, PlatformAccessory } from 'homebridge'; | ||
import { FlairPlatform } from './platform'; | ||
@@ -26,4 +26,4 @@ import { Vent, Client } from 'flair-api-ts'; | ||
// */ | ||
setTargetPosition(value: CharacteristicValue): void; | ||
getTargetPosition(callback: CharacteristicGetCallback): void; | ||
setTargetPosition(value: CharacteristicValue): Promise<void>; | ||
getTargetPosition(): Promise<CharacteristicValue>; | ||
getNewVentReadings(): Promise<Vent>; | ||
@@ -30,0 +30,0 @@ updateVentReadingsFromVent(vent: Vent): void; |
@@ -48,4 +48,4 @@ "use strict"; | ||
}) | ||
.on("set" /* SET */, this.setTargetPosition.bind(this)) | ||
.on("get" /* GET */, this.getTargetPosition.bind(this)); | ||
.onSet(this.setTargetPosition.bind(this)) | ||
.onGet(this.getTargetPosition.bind(this)); | ||
this.windowService.getCharacteristic(this.platform.Characteristic.CurrentPosition).setProps({ | ||
@@ -71,4 +71,4 @@ minStep: 50, | ||
this.airPurifierService.getCharacteristic(this.platform.Characteristic.RotationSpeed) | ||
.on("set" /* SET */, this.setTargetPosition.bind(this)) | ||
.on("get" /* GET */, this.getTargetPosition.bind(this)); | ||
.onSet(this.setTargetPosition.bind(this)) | ||
.onGet(this.getTargetPosition.bind(this)); | ||
this.mainService = this.airPurifierService; | ||
@@ -88,4 +88,4 @@ break; | ||
this.fanService.getCharacteristic(this.platform.Characteristic.RotationSpeed) | ||
.on("set" /* SET */, this.setTargetPosition.bind(this)) | ||
.on("get" /* GET */, this.getTargetPosition.bind(this)); | ||
.onSet(this.setTargetPosition.bind(this)) | ||
.onGet(this.getTargetPosition.bind(this)); | ||
this.mainService = this.fanService; | ||
@@ -122,12 +122,10 @@ break; | ||
// */ | ||
setTargetPosition(value) { | ||
this.client.setVentPercentOpen(this.vent, value).then((vent) => { | ||
this.updateVentReadingsFromVent(vent); | ||
this.platform.log.debug('Set Characteristic Percent Open -> ', value); | ||
}); | ||
async setTargetPosition(value) { | ||
const vent = await this.client.setVentPercentOpen(this.vent, value); | ||
this.updateVentReadingsFromVent(vent); | ||
this.platform.log.debug('Set Characteristic Percent Open -> ', value); | ||
} | ||
getTargetPosition(callback) { | ||
this.getNewVentReadings().then((vent) => { | ||
callback(null, vent.percentOpen); | ||
}); | ||
async getTargetPosition() { | ||
const vent = await this.getNewVentReadings(); | ||
return vent.percentOpen; | ||
} | ||
@@ -134,0 +132,0 @@ async getNewVentReadings() { |
{ | ||
"displayName": "Homebridge Flair", | ||
"name": "homebridge-flair", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "registry": "https://registry.npmjs.org/" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81023
859