mirror of
https://github.com/parnic/node-intellicenter.git
synced 2025-06-17 02:21:53 -05:00
46 lines
1.0 KiB
TypeScript
46 lines
1.0 KiB
TypeScript
import { ICParam } from "./param.js";
|
|
import { GetRequest, ICRequest, ICRequestObj } from "./request.js";
|
|
|
|
export enum HeaterType {
|
|
NoChange,
|
|
Off,
|
|
Heater,
|
|
SolarOnly,
|
|
SolarPreferred,
|
|
UltraTemp,
|
|
UltraTempPreferred,
|
|
HybridGas,
|
|
HybridUltraTemp,
|
|
HybridHybrid,
|
|
HybridDual,
|
|
MasterTemp,
|
|
MaxETherm,
|
|
ETI250,
|
|
}
|
|
|
|
/**
|
|
* Requests to turn a body's heater on or off.
|
|
*
|
|
* 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: string,
|
|
heaterType: HeaterType,
|
|
): ICRequest {
|
|
const req = GetRequest();
|
|
req.command = "SetParamList";
|
|
req.objectList = [];
|
|
|
|
const reqObj = new ICRequestObj();
|
|
reqObj.objnam = bodyObjnam;
|
|
reqObj.params = new ICParam();
|
|
reqObj.params.MODE = heaterType.toString();
|
|
req.objectList.push(reqObj);
|
|
|
|
return req;
|
|
}
|