Skip to content

Commit

Permalink
fix: AC warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin committed Jan 28, 2024
1 parent d0ef884 commit b53642d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/devices/AirConditioner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ export default class AirConditioner extends baseDevice {
this.service = this.accessory.getService(HeaterCooler) || this.accessory.addService(HeaterCooler, device.name);
this.service.setCharacteristic(Characteristic.Name, device.name);
this.service.getCharacteristic(Characteristic.Active)
.onSet(this.setActive.bind(this))
.updateValue(Characteristic.Active.INACTIVE);
.updateValue(Characteristic.Active.INACTIVE)
.onSet(this.setActive.bind(this));
this.service.getCharacteristic(Characteristic.CurrentHeaterCoolerState)
.updateValue(Characteristic.CurrentHeaterCoolerState.INACTIVE);

Expand All @@ -594,8 +594,12 @@ export default class AirConditioner extends baseDevice {
}

this.service.getCharacteristic(Characteristic.TargetHeaterCoolerState)
.onSet(this.setTargetState.bind(this))
.updateValue(targetStates[0]);
.updateValue(targetStates[0])
.onSet(this.setTargetState.bind(this));

if (this.Status.currentTemperature) {
this.service.updateCharacteristic(Characteristic.CurrentTemperature, this.Status.currentTemperature);
}

const currentTemperatureValue = device.deviceModel.value('airState.tempState.current') as RangeValue;
if (currentTemperatureValue) {
Expand All @@ -607,10 +611,6 @@ export default class AirConditioner extends baseDevice {
});
}

if (this.Status.currentTemperature) {
this.service.updateCharacteristic(Characteristic.CurrentTemperature, this.Status.currentTemperature);
}

let targetTemperatureValue = device.deviceModel.value('airState.tempState.limitMin') as RangeValue;
if (!targetTemperatureValue) {
targetTemperatureValue = device.deviceModel.value('airState.tempState.target') as RangeValue;
Expand Down

0 comments on commit b53642d

Please sign in to comment.