Files
node-screenlogic/messages/SLSetHeatMode.js
Michael 757a3be7d1 Set heat mode (#13)
* Function to set the heater mode + readme updates

* making the test set the heater to 'heat pump'
2019-11-24 16:53:53 -06:00

30 lines
680 B
JavaScript

'use strict';
const SLMessage = require('./SLMessage.js').SLMessage;
const MSG_ID = 12538;
exports.SLSetHeatMode = class SLSetHeatMode extends SLMessage {
constructor(controllerIndex, bodyType, heatMode) {
super(0, MSG_ID);
this.controllerIndex = controllerIndex;
this.bodyType = bodyType;
this.heatMode = heatMode;
// heatmodes:
// 0: "Off", 1: "Solar", 2 : "Solar Preferred", 3 : "Heat Pump", 4: "Don't Change"
}
encode() {
this.writeInt32LE(this.controllerIndex || 0);
this.writeInt32LE(this.bodyType || 0);
this.writeInt32LE(this.heatMode || 0);
super.encode();
}
static getResponseId() {
return MSG_ID + 1;
}
};