Added ability to set pool or spa heat setpoint

Fixes #9
This commit is contained in:
2019-06-21 00:12:29 -05:00
parent 3824437d7a
commit 1aa1dddb49
5 changed files with 56 additions and 0 deletions

View File

@ -206,6 +206,10 @@ class UnitConnection extends EventEmitter {
this.client.write(new messages.SLSetCircuitStateMessage(controllerId, circuitId, circuitState).toBuffer());
}
setSetPoint(controllerId, bodyType, temperature) {
this.client.write(new messages.SLSetHeatSetPointMessage(controllerId, bodyType, temperature).toBuffer());
}
onClientMessage(msg) {
// console.log('received message of length ' + msg.length);
if (msg.length < 4) {
@ -247,6 +251,10 @@ class UnitConnection extends EventEmitter {
// console.log(" it's circuit toggle ack");
this.emit('circuitStateChanged', new messages.SLSetCircuitStateMessage());
break;
case messages.SLSetHeatSetPointMessage.getResponseId():
// console.log(" it's a setpoint ack");
this.emit('setPointChanged', new messages.SLSetHeatSetPointMessage());
break;
case 13:
// console.log(" it's a login failure.");
this.emit('loginFailed');