This implementation is barebones and only does what I was able to find easily in the official app's source code. I'd love to do more with this, so any pull requests adding functionality would be welcomed. Closes https://github.com/parnic/node-screenlogic/issues/4
26 lines
490 B
JavaScript
26 lines
490 B
JavaScript
'use strict';
|
|
|
|
const SLMessage = require('./SLMessage.js').SLMessage;
|
|
|
|
const MSG_ID = 12556;
|
|
|
|
exports.SLLightControl = class SLLightControl extends SLMessage {
|
|
constructor(controllerIndex, command) {
|
|
super(0, MSG_ID);
|
|
|
|
this.controllerIndex = controllerIndex;
|
|
this.command = command;
|
|
}
|
|
|
|
encode() {
|
|
this.writeInt32LE(this.controllerIndex || 0);
|
|
this.writeInt32LE(this.command || 0);
|
|
|
|
super.encode();
|
|
}
|
|
|
|
static getResponseId() {
|
|
return MSG_ID + 1;
|
|
}
|
|
};
|