Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
fix aircon settings
Browse files Browse the repository at this point in the history
  • Loading branch information
takeyaqa committed Feb 27, 2021
1 parent ace987e commit fbb8667
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/airConAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export class NatureNemoAirConAccessory {
return;
}
this.state.targetHeatingCoolingState = value;
if (value === this.platform.Characteristic.TargetHeatingCoolingState.OFF) {
if (value === this.platform.Characteristic.TargetHeatingCoolingState.AUTO) {
const err = new Error('This plugin does not support auto');
this.platform.logger.error(err.message);
callback(err);
} else if (value === this.platform.Characteristic.TargetHeatingCoolingState.OFF) {
this.platform.natureRemoApi.setAirconPowerOff(this.id).then(() => {
this.platform.logger.info('[%s] Target Heater Cooler State <- OFF', this.name);
callback(null);
Expand Down Expand Up @@ -180,14 +184,10 @@ export class NatureNemoAirConAccessory {

private convertOperationMode(state: number): string {
switch (state) {
case this.platform.Characteristic.TargetHeatingCoolingState.OFF:
return 'power-off';
case this.platform.Characteristic.TargetHeatingCoolingState.HEAT:
return 'warm';
case this.platform.Characteristic.TargetHeatingCoolingState.COOL:
return 'cool';
case this.platform.Characteristic.TargetHeatingCoolingState.AUTO:
return 'auto';
default:
throw new Error(`This plugin does not support ${state}`);
}
Expand Down

0 comments on commit fbb8667

Please sign in to comment.