Skip to content

Commit

Permalink
Remove reported pumps that are outside the bounds of the max pumps. P…
Browse files Browse the repository at this point in the history
…reviously ET would put them back after we removed them.
  • Loading branch information
rstrouse committed Apr 22, 2022
1 parent a7403b7 commit c1f5a39
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 36 deletions.
3 changes: 2 additions & 1 deletion controller/boards/EasyTouchBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export class EasyTouchBoard extends SystemBoard {
[101, { name: 'feature8', desc: 'Feature 8' }]
]);
// We need this because there is a no-pump thing in *Touch.
// RKS: 05-04-21 The no-pump item was removed as this was only required for -webClient. deletePumpAsync should remove the pump from operation.
// RKS: 05-04-21 The no-pump item was removed as this was only required for -webClient. deletePumpAsync should remove the pump from operation. Do not use 255 as EasyTouch reports
// 255 or 0 for pumps that are not installed.
this.valueMaps.pumpTypes = new byteValueMap([
[1, { name: 'vf', desc: 'Intelliflo VF', maxPrimingTime: 6, minFlow: 15, maxFlow: 130, flowStepSize: 1, maxCircuits: 8, hasAddress: true }],
[64, { name: 'vsf', desc: 'Intelliflo VSF', minSpeed: 450, maxSpeed: 3450, speedStepSize: 10, minFlow: 15, maxFlow: 130, flowStepSize: 1, maxCircuits: 8, hasAddress: true }],
Expand Down
86 changes: 51 additions & 35 deletions controller/comms/messages/config/PumpMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,43 +36,59 @@ export class PumpMessage {
// packet 24/27/152/155 - Pump Config: IntelliTouch
const pumpId = msg.extractPayloadByte(0);
let type = msg.extractPayloadByte(1); // Avoid setting this then setting it back if we are mapping to a different value.
let isActive = type !== 0 && pumpId <= sys.equipment.maxPumps;
// RKS: 04-14-21 - Only create the pump if it is available. If the pump was previously defined as another type
// then it will be removed and recreated.
let pump: Pump = sys.pumps.getItemById(pumpId, pumpId <= sys.equipment.maxPumps && type !== 0);
if (pump.type !== type && type !== 0) {
sys.pumps.removeItemById(pumpId);
pump = sys.pumps.getItemById(pumpId, true);
}
pump.address = pumpId + 95;
switch (type) {
case 0: // none
pump.type = 0;
pump.isActive = false;
break;
case 64: // vsf
pump.type = type;
pump.isActive = true;
PumpMessage.processVSF_IT(msg);
break;
case 255: // vs 3050 on old panels.
case 128: // vs
case 134: // vs Ultra Efficiency
pump.type = 128;
pump.isActive = true;
PumpMessage.processVS_IT(msg);
break;
case 169: // vs+svrs
pump.type = 169;
pump.isActive = true;
PumpMessage.processVS_IT(msg);
break;
default: // vf - type is the background circuit
pump.type = 1; // force to type 1?
pump.isActive = true;
PumpMessage.processVF_IT(msg);
break;
}
if (pump.isActive) {
let pump: Pump = sys.pumps.getItemById(pumpId, isActive);
if(isActive) {
// Remap the combination pump types.
switch (type) {
case 0:
case 64:
case 169:
break;
case 255:
case 128:
case 134:
type = 128;
break;
default:
type = 1;
break;
}
if (pump.type !== type) {
sys.pumps.removeItemById(pumpId);
pump = sys.pumps.getItemById(pumpId, isActive);
}
pump.address = pumpId + 95;
switch (type) {
case 0: // none
pump.type = 0;
pump.isActive = false;
break;
case 64: // vsf
pump.type = type;
pump.isActive = true;
PumpMessage.processVSF_IT(msg);
break;
case 255: // vs 3050 on old panels.
case 128: // vs
case 134: // vs Ultra Efficiency
pump.type = 128;
pump.isActive = true;
PumpMessage.processVS_IT(msg);
break;
case 169: // vs+svrs
pump.type = 169;
pump.isActive = true;
PumpMessage.processVS_IT(msg);
break;
default: // vf - type is the background circuit
pump.type = 1; // force to type 1?
pump.isActive = true;
PumpMessage.processVF_IT(msg);
break;
}
if (typeof pump.name === 'undefined') pump.name = sys.board.valueMaps.pumpTypes.get(pump.type).desc;
const spump = state.pumps.getItemById(pump.id, true);
spump.name = pump.name;
Expand Down

0 comments on commit c1f5a39

Please sign in to comment.