mirror of
https://github.com/parnic/node-intellicenter.git
synced 2025-06-17 02:21:53 -05:00
This adds a bunch of messages to retrieve and set various things on the controller. It also groups the messages under one export to simplify the process of using and discovering many of them from one location. Some of these are WIP/probably not portable to other systems. This also adds the ability to set multiple circuits at once.
26 lines
809 B
TypeScript
26 lines
809 B
TypeScript
import { ICParam } from "./param.js";
|
|
import { GetRequest, ICRequest, ICRequestObj } from "./request.js";
|
|
|
|
/**
|
|
* Requests to change the setpoint of a temperature circuit.
|
|
*
|
|
* Use the `objnam` of the circuit to be set and give the temperature in the same units that the
|
|
* controller is set to (so, give a number in Celsius if the system is in Celsius or Fahrenheit
|
|
* if the system is in Fahrenheit).
|
|
*
|
|
* @returns the object used to issue this request
|
|
*/
|
|
export function SetSetpoint(objnam: string, setpoint: number): ICRequest {
|
|
const req = GetRequest();
|
|
req.command = "SetParamList";
|
|
req.objectList = [];
|
|
|
|
const reqObj = new ICRequestObj();
|
|
reqObj.objnam = objnam;
|
|
reqObj.params = new ICParam();
|
|
reqObj.params.LOTMP = setpoint.toString();
|
|
req.objectList.push(reqObj);
|
|
|
|
return req;
|
|
}
|