@@ -3,7 +3,7 @@ import { ClimateMode, CompressorMode } from './types';
33import { ActronQuePlatform } from './platform' ;
44import { HvacZone } from './hvacZone' ;
55
6- // This class represents the master controller, a separate class is used for representing zones (or will be once i write it)
6+ // This class represents the zone controller
77export class ZoneControllerAccessory {
88 private hvacService : Service ;
99 // some versions of the zone sensor do not support humidity
@@ -232,11 +232,12 @@ export class ZoneControllerAccessory {
232232 await this . platform . hvacInstance . setHeatTemp ( value as number + 2 ) ;
233233 await this . platform . hvacInstance . getStatus ( ) ;
234234 }
235- }
236- if ( value > this . zone . maxHeatSetPoint ) {
237- value = this . zone . maxHeatSetPoint ;
238- } else if ( value < this . zone . minHeatSetPoint ) {
239- value = this . zone . minHeatSetPoint ;
235+ } else {
236+ if ( value > this . zone . maxHeatSetPoint ) {
237+ value = this . zone . maxHeatSetPoint ;
238+ } else if ( value < this . zone . minHeatSetPoint ) {
239+ value = this . zone . minHeatSetPoint ;
240+ }
240241 }
241242 await this . zone . setHeatTemp ( value as number ) ;
242243 this . platform . log . debug ( `Set Zone ${ this . zone . zoneName } Target Heating Temperature -> ` , value ) ;
@@ -251,18 +252,24 @@ export class ZoneControllerAccessory {
251252 async setCoolingThresholdTemperature ( value : CharacteristicValue ) {
252253 this . checkHvacComms ( ) ;
253254 if ( this . platform . hvacInstance . zonesPushMaster === true ) {
255+ this . platform . log . debug ( 'zones push master is set to True' ) ;
254256 if ( value > this . zone . maxCoolSetPoint ) {
255- await this . platform . hvacInstance . setCoolTemp ( value as number + 2 ) ;
257+ await this . platform . hvacInstance . setCoolTemp ( value as number - 2 ) ;
258+ this . platform . log . debug ( `Value is greater than MAX cool set point of ${ this . zone . maxCoolSetPoint } , SETTING MASTER TO -> ` , value ) ;
256259 await this . platform . hvacInstance . getStatus ( ) ;
257260 } else if ( value < this . zone . minCoolSetPoint ) {
258261 await this . platform . hvacInstance . setCoolTemp ( value as number ) ;
262+ this . platform . log . debug ( `Value is less than MIN cool set point of ${ this . zone . minCoolSetPoint } , SETTING MASTER TO -> ` , value ) ;
259263 await this . platform . hvacInstance . getStatus ( ) ;
260264 }
261- }
262- if ( value > this . zone . maxCoolSetPoint ) {
263- value = this . zone . maxCoolSetPoint ;
264- } else if ( value < this . zone . minCoolSetPoint ) {
265- value = this . zone . minCoolSetPoint ;
265+ } else {
266+ if ( value > this . zone . maxCoolSetPoint ) {
267+ value = this . zone . maxCoolSetPoint ;
268+ this . platform . log . debug ( `Value is greater than max cool set point of ${ this . zone . maxCoolSetPoint } , CHANGING TO -> ` , value ) ;
269+ } else if ( value < this . zone . minCoolSetPoint ) {
270+ value = this . zone . minCoolSetPoint ;
271+ this . platform . log . debug ( `Value is less than MIN cool set point of ${ this . zone . minCoolSetPoint } , CHANGING TO -> ` , value ) ;
272+ }
266273 }
267274 await this . zone . setCoolTemp ( value as number ) ;
268275 this . platform . log . debug ( `Set Zone ${ this . zone . zoneName } Target Cooling Temperature -> ` , value ) ;
0 commit comments