SLCancelDelay message added (#29)

This commit is contained in:
Bruce Sheplan
2020-06-09 16:43:09 -05:00
committed by GitHub
parent 626ca5b64f
commit db522ba5db
3 changed files with 30 additions and 0 deletions

View File

@ -281,6 +281,10 @@ class UnitConnection extends EventEmitter {
this.client.write(new messages.SLSetPumpFlow(pumpId, circuitId, setPoint, isRPMs).toBuffer());
}
cancelDelay() {
this.client.write(new messages.SLCancelDelay().toBuffer());
}
onClientMessage(msg) {
debugUnit('received message of length %d', msg.length);
if (msg.length < 4) {
@ -370,6 +374,9 @@ class UnitConnection extends EventEmitter {
debugUnit(" it's a set pump flow ack");
this.emit('setPumpFlow', new messages.SLSetPumpFlow());
break;
case messages.SLCancelDelay.getResponseId():
this.emit('cancelDelay', new messages.SLCancelDelay());
break;
case 13:
debugUnit(" it's a login failure.");
this.emit('loginFailed');

22
messages/SLCancelDelay.js Normal file
View File

@ -0,0 +1,22 @@
'use strict';
const SLMessage = require('./SLMessage.js').SLMessage;
const MSG_ID = 12580;
exports.SLCancelDelay = class SLCancelDelay extends SLMessage {
constructor() {
super(0, MSG_ID);
}
encode() {
this.writeInt32LE(0);
super.encode();
}
static getResponseId() {
return MSG_ID + 1;
}
};

View File

@ -22,3 +22,4 @@ exports.SLSetScheduleEventById = require('./SLSetScheduleEventById.js').SLSetSch
exports.SLSetCircuitRuntimeById = require('./SLSetCircuitRuntimeById.js').SLSetCircuitRuntimeById;
exports.SLGetPumpStatus = require('./SLGetPumpStatus.js').SLGetPumpStatus;
exports.SLSetPumpFlow = require('./SLSetPumpFlow.js').SLSetPumpFlow;
exports.SLCancelDelay = require('./SLCancelDelay.js').SLCancelDelay;