Set heat mode (#13)

* Function to set the heater mode + readme updates

* making the test set the heater to 'heat pump'
This commit is contained in:
Michael
2019-11-24 16:53:53 -06:00
committed by parnic
parent 1dcbe3883b
commit 757a3be7d1
5 changed files with 102 additions and 0 deletions

View File

@ -210,6 +210,10 @@ class UnitConnection extends EventEmitter {
this.client.write(new messages.SLSetHeatSetPointMessage(controllerId, bodyType, temperature).toBuffer());
}
setHeatMode(controllerId, bodyType, heatMode) {
this.client.write(new messages.SLSetHeatModeMessage(controllerId, bodyType, heatMode).toBuffer());
}
sendLightCommand(controllerId, command) {
this.client.write(new messages.SLLightControlMessage(controllerId, command).toBuffer());
}
@ -259,6 +263,10 @@ class UnitConnection extends EventEmitter {
// console.log(" it's a setpoint ack");
this.emit('setPointChanged', new messages.SLSetHeatSetPointMessage());
break;
case messages.SLSetHeatModeMessage.getResponseId():
// console.log(" it's a heater mode ack");
this.emit('heatModeChanged', new messages.SLSetHeatModeMessage());
break;
case messages.SLLightControlMessage.getResponseId():
// console.log(" it's a light control ack");
this.emit('sentLightCommand', new messages.SLLightControlMessage());