Ensure all messages populate the response senderId

Fixed `addClient` and `removeClient` events returning `SLCancelDelay` objects. This shouldn't really make a difference as there are no properties to worry about on one or the other, but it was still incorrect and could cause bugs if stuff was added to those messages in the future.
This commit is contained in:
2020-08-12 08:51:44 -05:00
parent 8294947f8c
commit 27bdf0380e
11 changed files with 100 additions and 57 deletions

View File

@ -6,11 +6,16 @@ const MSG_ID = 12528;
exports.SLSetHeatSetPoint = class SLSetHeatSetPoint extends SLMessage {
constructor(controllerIndex, bodyType, temperature, senderId) {
super(senderId, MSG_ID);
if (typeof controllerIndex === 'object') {
var size = controllerIndex.readInt32LE(4) + 8;
super(controllerIndex, MSG_ID, size);
} else {
super(senderId, MSG_ID);
this.controllerIndex = controllerIndex;
this.bodyType = bodyType;
this.temperature = temperature;
this.controllerIndex = controllerIndex;
this.bodyType = bodyType;
this.temperature = temperature;
}
}
encode() {