Schedule Editing Additions (#24)

* Added support for: adding schedule events, deleting schedule events, listing schedule events and updating scheduled events
This commit is contained in:
Bruce Sheplan
2020-06-03 22:07:33 -05:00
committed by GitHub
parent def2d8aad4
commit 9c72e7b61d
6 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,38 @@
'use strict';
const SLMessage = require('./SLMessage.js').SLMessage;
const MSG_ID = 12548;
exports.SLSetScheduleEventById = class SLSetScheduleEventById extends SLMessage {
constructor(buf, scheduleId, circuitId, startTime, stopTime, dayMask, flags, heatCmd, heatSetPoint) {
var size;
if (buf) {
size = buf.readInt32LE(4) + 8;
}
super(0, MSG_ID, size);
if (!buf) {
this.writeInt32LE(0);
this.writeInt32LE(scheduleId);
this.writeInt32LE(circuitId);
this.writeInt32LE(startTime);
this.writeInt32LE(stopTime);
this.writeInt32LE(dayMask);
this.writeInt32LE(flags);
this.writeInt32LE(heatCmd);
this.writeInt32LE(heatSetPoint);
} else {
this._wroteSize = true;
this.writeBuffer(buf, 0);
this.decode();
}
}
static getResponseId() {
return MSG_ID + 1;
}
};