Files
node-intellicenter/messages/configuration.ts
Parnic 7daf47ac18 Fleshing out more messages
Getting a feel for how the development experience is with this setup. With the previous idea of abstracting the request into a getSystemInfo() function on the Unit itself, the documentation for what to expect from GetSystemInfo either had to live in two places or be presented as a link to the canonical location. Neither felt great, so I think the caller can just call send(GetRequest()) themselves.

Also added the first "set" message which is capable of toggling a body or circuit.
2025-01-03 16:01:58 -06:00

24 lines
905 B
TypeScript

import { GetRequest, ICRequest } from "./request.js";
/**
* Requests the configuration of bodies and circuits available to this controller.
*
* The response contains the list of bodies and circuits under the `answer` field.
* Each item has an `objnam` that should be used to reference that item for future requests,
* and `params`.`SNAME` is the user-entered friendly name that can be displayed for the item.
* `params`.`OBJTYP` will be either BODY or CIRCUIT depending on the item it's describing.
*
* Some items, such as the Pool body, will have the `params`.`OBJLIST` array populated with
* a series of attached items such as a chlorinator device.
*
* @returns the object used to issue this request
*/
export function GetSystemConfiguration(): ICRequest {
const req = GetRequest();
req.command = "GetQuery";
req.queryName = "GetConfiguration";
req.arguments = "";
return req;
}