Fixed `addClient` and `removeClient` events returning `SLCancelDelay` objects. This shouldn't really make a difference as there are no properties to worry about on one or the other, but it was still incorrect and could cause bugs if stuff was added to those messages in the future.
42 lines
1023 B
JavaScript
42 lines
1023 B
JavaScript
'use strict';
|
|
|
|
const SLMessage = require('./SLMessage.js').SLMessage;
|
|
|
|
const MSG_ID = 12586;
|
|
|
|
exports.SLSetPumpFlow = class SLSetPumpFlow extends SLMessage {
|
|
constructor(pumpId, circuitId, setPoint, isRPMs, senderId) {
|
|
if (typeof pumpId === 'object') {
|
|
var size = pumpId.readInt32LE(4) + 8;
|
|
super(pumpId, MSG_ID, size);
|
|
} else {
|
|
super(senderId, MSG_ID);
|
|
|
|
this.pumpId = pumpId;
|
|
this.circuitId = circuitId;
|
|
this.setPoint = setPoint;
|
|
|
|
if (isRPMs === true) {
|
|
this.isRPMs = 1;
|
|
} else {
|
|
this.isRPMs = 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
encode() {
|
|
this.writeInt32LE(0); // Always 0 in my case
|
|
this.writeInt32LE(this.pumpId); // presumably pumpId, always 0 in my case
|
|
this.writeInt32LE(this.circuitId); // This is indexed to the array of circuits returned in GetPumpStatus
|
|
this.writeInt32LE(this.setPoint);
|
|
this.writeInt32LE(this.isRPMs); // 0 for GPM, 1 for RPMs
|
|
|
|
super.encode();
|
|
}
|
|
|
|
static getResponseId() {
|
|
return MSG_ID + 1;
|
|
}
|
|
};
|