Skip to content

Commit

Permalink
only use heating mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SanterreJo committed Oct 26, 2024
1 parent 700e2e9 commit 84d589c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/devices/Thermostat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export class Thermostat extends HiloDevice<"Thermostat"> {
.onGet(this.getCurrentHeatingCoolingState.bind(this))
.setProps({
validValues: [
this.api.hap.Characteristic.CurrentHeatingCoolingState.OFF,
this.api.hap.Characteristic.CurrentHeatingCoolingState.HEAT,
],
maxValue: this.api.hap.Characteristic.CurrentHeatingCoolingState.HEAT,
Expand All @@ -33,9 +32,9 @@ export class Thermostat extends HiloDevice<"Thermostat"> {
.onSet(this.setTargetHeatingCoolingState.bind(this))
.setProps({
validValues: [
this.api.hap.Characteristic.TargetHeatingCoolingState.AUTO,
this.api.hap.Characteristic.TargetHeatingCoolingState.HEAT,
],
maxValue: this.api.hap.Characteristic.TargetHeatingCoolingState.AUTO,
maxValue: this.api.hap.Characteristic.TargetHeatingCoolingState.HEAT,
});
this.service
.getCharacteristic(this.api.hap.Characteristic.CurrentTemperature)
Expand Down Expand Up @@ -76,24 +75,20 @@ export class Thermostat extends HiloDevice<"Thermostat"> {
this.api.hap.Characteristic.CurrentHeatingCoolingState
)
?.updateValue(
value?.value
? this.api.hap.Characteristic.CurrentHeatingCoolingState.HEAT
: this.api.hap.Characteristic.CurrentHeatingCoolingState.OFF
this.api.hap.Characteristic.CurrentHeatingCoolingState.HEAT
);
break;
}
}

private async getCurrentHeatingCoolingState(): Promise<CharacteristicValue> {
this.logger.debug(`Getting ${this.device.name} currentHeatingCoolingState`);
return this.values.Heating?.value
? this.api.hap.Characteristic.CurrentHeatingCoolingState.HEAT
: this.api.hap.Characteristic.CurrentHeatingCoolingState.OFF;
return this.api.hap.Characteristic.CurrentHeatingCoolingState.HEAT;
}

private async getTargetHeatingCoolingState(): Promise<CharacteristicValue> {
this.logger.debug(`Getting ${this.device.name} targetHeatingCoolingState`);
return this.api.hap.Characteristic.TargetHeatingCoolingState.AUTO;
return this.api.hap.Characteristic.TargetHeatingCoolingState.HEAT;
}

private async setTargetHeatingCoolingState(value: CharacteristicValue) {
Expand Down

0 comments on commit 84d589c

Please sign in to comment.