Added SLAddClient / SLRemoveClient messages (#30)

This commit is contained in:
Bruce Sheplan
2020-06-10 08:05:32 -05:00
committed by GitHub
parent 71c606cb94
commit b2439cd90c
6 changed files with 94 additions and 0 deletions

24
messages/SLAddClient.js Normal file
View File

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

View File

@ -3,6 +3,7 @@
const SLMessage = require('./SLMessage.js').SLMessage;
const MSG_ID = 12526;
const ASYNC_MSG_ID = 12500;
const SPA_CIRCUIT_ID = 500;
const POOL_CIRCUIT_ID = 505;
@ -112,4 +113,8 @@ exports.SLPoolStatusMessage = class SLPoolStatusMessage extends SLMessage {
static getResponseId() {
return MSG_ID + 1;
}
static getAsyncResponseId() {
return ASYNC_MSG_ID;
}
};

View File

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

View File

@ -23,3 +23,5 @@ exports.SLSetCircuitRuntimeById = require('./SLSetCircuitRuntimeById.js').SLSetC
exports.SLGetPumpStatus = require('./SLGetPumpStatus.js').SLGetPumpStatus;
exports.SLSetPumpFlow = require('./SLSetPumpFlow.js').SLSetPumpFlow;
exports.SLCancelDelay = require('./SLCancelDelay.js').SLCancelDelay;
exports.SLAddClient = require('./SLAddClient.js').SLAddClient;
exports.SLRemoveClient = require('./SLRemoveClient.js').SLRemoveClient;