Added salt cell config Added system version Tweaked pool status to pre-adjust values Chem data uses big endian encoding for most of its values (but not all) while everything else (so far) has used little endian. Chem data also encodes bits like whether there's a system error or not inside other pieces of data like salt levels. There are also bytes in the returned data that I don't know the significance of just yet. Pool status was tweaked such that asking for pH is corrected down to its proper float representation (e.g. 7.60) instead of the integer representation that is sent by the system (760). Same for water balance/saturation. Salt now returns the proper value (scaled up by 50) instead of the value sent over by the system, which I guess is the maximum precision the system can provide.
28 lines
707 B
JavaScript
Executable File
28 lines
707 B
JavaScript
Executable File
const SLMessage = require('./SLMessage.js').SLMessage;
|
|
|
|
exports.SLSaltCellConfigMessage = class SLSaltCellConfigMessage extends SLMessage {
|
|
constructor(buf) {
|
|
super(0, 12572);
|
|
if (!buf) {
|
|
this.writeInt32LE(0); // controller index
|
|
} else {
|
|
this._wroteSize = true;
|
|
this.writeBuffer(buf, 0);
|
|
|
|
this.decode();
|
|
}
|
|
}
|
|
|
|
decode() {
|
|
super.decode();
|
|
|
|
this.installed = this.readInt32LE() === 1;
|
|
this.status = this.readInt32LE();
|
|
this.level1 = this.readInt32LE();
|
|
this.level2 = this.readInt32LE();
|
|
this.salt = this.readInt32LE() * 50;
|
|
this.flags = this.readInt32LE();
|
|
this.superChlorTimer = this.readInt32LE();
|
|
}
|
|
}
|