From db522ba5dbabbdca0cd083378f985385c29c8e8e Mon Sep 17 00:00:00 2001 From: Bruce Sheplan Date: Tue, 9 Jun 2020 16:43:09 -0500 Subject: [PATCH] SLCancelDelay message added (#29) --- index.js | 7 +++++++ messages/SLCancelDelay.js | 22 ++++++++++++++++++++++ messages/index.js | 1 + 3 files changed, 30 insertions(+) create mode 100644 messages/SLCancelDelay.js diff --git a/index.js b/index.js index 7ff886d..e9397bd 100644 --- a/index.js +++ b/index.js @@ -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'); diff --git a/messages/SLCancelDelay.js b/messages/SLCancelDelay.js new file mode 100644 index 0000000..fa748c7 --- /dev/null +++ b/messages/SLCancelDelay.js @@ -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; + } +}; diff --git a/messages/index.js b/messages/index.js index 8d8bde0..9823ce6 100644 --- a/messages/index.js +++ b/messages/index.js @@ -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;