mirror of
https://github.com/parnic/node-intellicenter.git
synced 2025-06-16 10:10:13 -05:00
This allows require() and import to work for even better compatibility between CJS and ESM consumers. I dislike that this kills our ability for top-level awaits in example.ts, but seeing as how my primary use case for this library is a commonjs module, I think this is a fair trade-off. Also changed "messages" to not encapsulate its export under the name "messages" to remove some repetition in importing "messages" and still needing to do "messages." to get the methods out. Now it's simple to import each message by name or group them under something like "messages" as desired on a per-library-user basis. Refs: * https://www.kravchyk.com/typescript-npm-package-json-exports/ * https://arethetypeswrong.github.io/ * https://evertpot.com/universal-commonjs-esm-typescript-packages/
27 lines
1.1 KiB
JavaScript
27 lines
1.1 KiB
JavaScript
import { GetRequest, ICRequestObj } from "./request.js";
|
|
/**
|
|
* Requests the status of bodies known to this controller.
|
|
*
|
|
* The response contains the list of bodies in the `params` field. Each body has
|
|
* an `objnam` that should be used to reference that body for future requests.
|
|
* When `params`.`STATUS` is `"OFF"`, use `params`.`LSTTMP` to get the temperature
|
|
* of the body the last time it was on, or `params`.`TEMP` to get the temperature
|
|
* if the `STATUS` is `"ON"`. `LSTTMP` seems to always be accurate, however, whether
|
|
* the body is currently on or off.
|
|
*
|
|
* @returns the object used to issue this request
|
|
*/
|
|
export function GetBodyStatus() {
|
|
const req = GetRequest();
|
|
req.command = "GetParamList";
|
|
req.condition = "OBJTYP = BODY";
|
|
req.objectList = [];
|
|
const reqObj = new ICRequestObj();
|
|
reqObj.objnam = "ALL";
|
|
reqObj.keys = [
|
|
"OBJTYP: SUBTYP: SNAME: LISTORD: FILTER: LOTMP: TEMP: HITMP: HTSRC: PRIM: SEC: ACT1: ACT2: ACT3: ACT4: CIRCUIT: SPEED: BOOST: SELECT: STATUS: HTMODE : LSTTMP : HEATER : VOL : MANUAL : HNAME : MODE",
|
|
];
|
|
req.objectList.push(reqObj);
|
|
return req;
|
|
}
|
|
//# sourceMappingURL=body-status.js.map
|