diff --git a/package.json b/package.json index 25bc31a..40d7414 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": false, "displayName": "Homebridge ConnectLife AC", "name": "homebridge-connectlife-ac", - "version": "1.3.0", + "version": "1.3.1", "description": "Control your ConnectLife air conditioner with Homebridge", "license": "Apache-2.0", "homepage": "https://github.com/ghosty2004/homebridge-connectlife-ac", diff --git a/src/accessory/TemperatureAccessory.ts b/src/accessory/TemperatureAccessory.ts index 4f6078e..53f60e8 100644 --- a/src/accessory/TemperatureAccessory.ts +++ b/src/accessory/TemperatureAccessory.ts @@ -120,11 +120,21 @@ export class TemperatureAccessory { } setSwingMode(value: CharacteristicValue) { + this.connectLifeApi.changeDeviceProperties(this.deviceNickName, { + t_up_down: value, + }); this.platform.log.info('Set SwingMode', value); } - getSwingMode(): CharacteristicValue { - return 0; + async getSwingMode(): Promise { + const { t_up_down } = await this.connectLifeApi.getDeviceProperties( + this.deviceNickName, + { + t_up_down: 'integer', + }, + ); + + return t_up_down; } async setCoolingThresholdTemperature(value: CharacteristicValue) {