Skip to content

Commit

Permalink
feat: swing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ghosty2004 committed Jul 1, 2024
1 parent 0572af9 commit ca876a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 12 additions & 2 deletions src/accessory/TemperatureAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<CharacteristicValue> {
const { t_up_down } = await this.connectLifeApi.getDeviceProperties(
this.deviceNickName,
{
t_up_down: 'integer',
},
);

return t_up_down;
}

async setCoolingThresholdTemperature(value: CharacteristicValue) {
Expand Down

0 comments on commit ca876a0

Please sign in to comment.