mirror of
https://github.com/parnic/node-intellicenter.git
synced 2025-06-17 02:21:53 -05:00
@ -1,26 +1,39 @@
|
||||
import { ICParam } from "./param.js";
|
||||
import { GetRequest, ICRequestObj } from "./request.js";
|
||||
export var HeaterType;
|
||||
(function (HeaterType) {
|
||||
HeaterType[HeaterType["NoChange"] = 0] = "NoChange";
|
||||
HeaterType[HeaterType["Off"] = 1] = "Off";
|
||||
HeaterType[HeaterType["Heater"] = 2] = "Heater";
|
||||
HeaterType[HeaterType["SolarOnly"] = 3] = "SolarOnly";
|
||||
HeaterType[HeaterType["SolarPreferred"] = 4] = "SolarPreferred";
|
||||
HeaterType[HeaterType["UltraTemp"] = 5] = "UltraTemp";
|
||||
HeaterType[HeaterType["UltraTempPreferred"] = 6] = "UltraTempPreferred";
|
||||
HeaterType[HeaterType["HybridGas"] = 7] = "HybridGas";
|
||||
HeaterType[HeaterType["HybridUltraTemp"] = 8] = "HybridUltraTemp";
|
||||
HeaterType[HeaterType["HybridHybrid"] = 9] = "HybridHybrid";
|
||||
HeaterType[HeaterType["HybridDual"] = 10] = "HybridDual";
|
||||
HeaterType[HeaterType["MasterTemp"] = 11] = "MasterTemp";
|
||||
HeaterType[HeaterType["MaxETherm"] = 12] = "MaxETherm";
|
||||
HeaterType[HeaterType["ETI250"] = 13] = "ETI250";
|
||||
})(HeaterType || (HeaterType = {}));
|
||||
/**
|
||||
* Requests to turn a body's heater on or off.
|
||||
*
|
||||
* This is very WIP. For my pool and my heater configuration, the MODE needs to be 11 to enable my
|
||||
* heater and 1 to disable all heaters. I have a feeling 11 is unique to my system's configuration,
|
||||
* but I can't yet determine how to know what 11 maps to in order to make this more generic.
|
||||
*
|
||||
* Note that this doesn't necessarily start heating the body by itself - if the body's pump is
|
||||
* currently off, enabling the heater will not turn it on. If the pump/body is on, then this will
|
||||
* enable the heater and no further action is required.
|
||||
*
|
||||
* @returns the object used to issue this request
|
||||
*/
|
||||
export function SetHeatMode(bodyObjnam, enabled) {
|
||||
export function SetHeatMode(bodyObjnam, heaterType) {
|
||||
const req = GetRequest();
|
||||
req.command = "SetParamList";
|
||||
req.objectList = [];
|
||||
const reqObj = new ICRequestObj();
|
||||
reqObj.objnam = bodyObjnam;
|
||||
reqObj.params = new ICParam();
|
||||
reqObj.params.MODE = enabled ? "11" : "1";
|
||||
reqObj.params.MODE = heaterType.toString();
|
||||
req.objectList.push(reqObj);
|
||||
return req;
|
||||
}
|
||||
|
Reference in New Issue
Block a user