Skip to content

Commit

Permalink
fix zone push master temp logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jxg81 committed Mar 20, 2023
1 parent aeaeecf commit 8370384
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 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 Actron Que",
"name": "homebridge-actron-que",
"version": "1.2.7-beta.5",
"version": "1.2.7-beta.6",
"description": "Homebridge plugin for controlling Actron Que controller systems",
"license": "Apache-2.0",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/masterControllerAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Service, PlatformAccessory, CharacteristicValue, HAPStatus } from 'home
import { ClimateMode, CompressorMode, FanMode, PowerState } from './types';
import { ActronQuePlatform } from './platform';

// This class represents the master controller, a separate class is used for representing zones (or will be once i write it)
// This class represents the master controller, a separate class is used for representing zones
export class MasterControllerAccessory {
private hvacService: Service;
private humidityService: Service;
Expand Down
29 changes: 15 additions & 14 deletions src/zoneControllerAccessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ClimateMode, CompressorMode } from './types';
import { ActronQuePlatform } from './platform';
import { HvacZone } from './hvacZone';

// This class represents the master controller, a separate class is used for representing zones (or will be once i write it)
// This class represents the zone controller
export class ZoneControllerAccessory {
private hvacService: Service;
// some versions of the zone sensor do not support humidity
Expand Down Expand Up @@ -232,11 +232,12 @@ export class ZoneControllerAccessory {
await this.platform.hvacInstance.setHeatTemp(value as number + 2);
await this.platform.hvacInstance.getStatus();
}
}
if (value > this.zone.maxHeatSetPoint) {
value = this.zone.maxHeatSetPoint;
} else if (value < this.zone.minHeatSetPoint) {
value = this.zone.minHeatSetPoint;
} else {
if (value > this.zone.maxHeatSetPoint) {
value = this.zone.maxHeatSetPoint;
} else if (value < this.zone.minHeatSetPoint) {
value = this.zone.minHeatSetPoint;
}
}
await this.zone.setHeatTemp(value as number);
this.platform.log.debug(`Set Zone ${this.zone.zoneName} Target Heating Temperature -> `, value);
Expand All @@ -261,14 +262,14 @@ export class ZoneControllerAccessory {
this.platform.log.debug(`Value is less than MIN cool set point of ${this.zone.minCoolSetPoint}, SETTING MASTER TO -> `, value);
await this.platform.hvacInstance.getStatus();
}
}
if (value > this.zone.maxCoolSetPoint) {
value = this.zone.maxCoolSetPoint;
this.platform.log.debug(`Value is greater than max cool set point of ${this.zone.maxCoolSetPoint}, CHANGING TO -> `, value);
} else if (value < this.zone.minCoolSetPoint) {
value = this.zone.minCoolSetPoint;
this.platform.log.debug(`Value is less than MIN cool set point of ${this.zone.minCoolSetPoint}, CHANGING TO -> `, value);

} else {
if (value > this.zone.maxCoolSetPoint) {
value = this.zone.maxCoolSetPoint;
this.platform.log.debug(`Value is greater than max cool set point of ${this.zone.maxCoolSetPoint}, CHANGING TO -> `, value);
} else if (value < this.zone.minCoolSetPoint) {
value = this.zone.minCoolSetPoint;
this.platform.log.debug(`Value is less than MIN cool set point of ${this.zone.minCoolSetPoint}, CHANGING TO -> `, value);
}
}
await this.zone.setCoolTemp(value as number);
this.platform.log.debug(`Set Zone ${this.zone.zoneName} Target Cooling Temperature -> `, value);
Expand Down

0 comments on commit 8370384

Please sign in to comment.