Added ability to set circuit state
This allows for, for example, turning on a water feature or changing pool/spa active status.
This commit is contained in:
25
messages/SLSetCircuitStateMessage.js
Normal file
25
messages/SLSetCircuitStateMessage.js
Normal file
@ -0,0 +1,25 @@
|
||||
const SLMessage = require('./SLMessage.js').SLMessage;
|
||||
|
||||
const MSG_ID = 12530;
|
||||
|
||||
exports.SLSetCircuitStateMessage = class SLSetCircuitStateMessage extends SLMessage {
|
||||
constructor(controllerId, circuitId, circuitState) {
|
||||
super(0, MSG_ID);
|
||||
|
||||
this.controllerId = controllerId;
|
||||
this.circuitId = circuitId;
|
||||
this.circuitState = circuitState;
|
||||
}
|
||||
|
||||
encode() {
|
||||
this.writeInt32LE(this.controllerId || 0);
|
||||
this.writeInt32LE(this.circuitId || 0);
|
||||
this.writeInt32LE(this.circuitState || 0);
|
||||
|
||||
super.encode();
|
||||
}
|
||||
|
||||
static getResponseId() {
|
||||
return MSG_ID + 1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user