Added support for controlling the salt cell generator output levels

Closes #17
This commit is contained in:
2020-02-08 15:33:13 -06:00
parent c310885598
commit 0397e8ad8f
4 changed files with 57 additions and 4 deletions

View File

@ -218,6 +218,10 @@ class UnitConnection extends EventEmitter {
this.client.write(new messages.SLLightControlMessage(controllerId, command).toBuffer());
}
setSaltCellOutput(controllerId, poolOutput, spaOutput) {
this.client.write(new messages.SLSetSaltCellConfigMessage(controllerId, poolOutput, spaOutput).toBuffer());
}
onClientMessage(msg) {
// console.log('received message of length ' + msg.length);
if (msg.length < 4) {
@ -271,6 +275,10 @@ class UnitConnection extends EventEmitter {
// console.log(" it's a light control ack");
this.emit('sentLightCommand', new messages.SLLightControlMessage());
break;
case messages.SLSetSaltCellConfigMessage.getResponseId():
// console.log(" it's a set salt cell config ack");
this.emit('setSaltCellConfig', new messages.SLSetSaltCellConfigMessage());
break;
case 13:
// console.log(" it's a login failure.");
this.emit('loginFailed');