Add list-objects script

This can be used to find all the controllable circuits in your system.

When invoked with `npm run list-objects` or `node esm/list-objects.js` it will search for units, then request and format+display the objects to the user. There are a few arguments available:
* --controllerAddr=1.2.3.4
  * Specifies the IntelliCenter controller's address directly which skips the searching phase.
* --controllerPort=1234
  * Specifies the port to use when connecting to the controller (probably should never use this; does nothing if --controllerAddr is not specified)
* --multicastAddr=1.2.3.4
  * Specifies the address of the network interface to send the multicast search packet on (useful if you have multiple adapters/interfaces and the system is picking the wrong one; does nothing if --controllerAddr is specified)
* --onlyToggleable
  * Only displays objects which can be toggled on or off

Note that if you are invoking this with `npm run list-objects` then the arguments must be specified after an empty `--` so that they are given to the script rather than npm itself. Example: `npm run list-objects -- --controllerAddr=10.0.0.41 --onlyToggleable`
This commit is contained in:
2025-01-05 15:24:37 -06:00
parent c445a844ee
commit 3e40e015d9
9 changed files with 271 additions and 1 deletions

1
cjs/list-objects.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

78
cjs/list-objects.js Normal file
View File

@ -0,0 +1,78 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const minimist_1 = __importDefault(require("minimist"));
const index_js_1 = require("./index.js");
const request_js_1 = require("./messages/request.js");
const argv = (0, minimist_1.default)(process.argv.slice(2));
let endpoint = "";
let port = 6680;
if (typeof argv.controllerAddr === "string") {
endpoint = argv.controllerAddr;
}
if (typeof argv.controllerPort === "number") {
port = argv.controllerPort;
}
const example = async () => {
if (!endpoint) {
console.log("searching for units...");
let multicastAddr;
if (typeof argv.multicastAddr === "string") {
multicastAddr = argv.multicastAddr;
}
const finder = new index_js_1.FindUnits(multicastAddr);
const units = await finder.searchAsync(3000);
finder.close();
if (units.length === 0) {
throw new Error("no IntelliCenter units found, exiting.");
}
if (units.length > 1) {
throw new Error(`found more than one IntelliCenter unit, unsure which one to use. ${JSON.stringify(units)}`);
}
endpoint = units[0].addressStr;
port = units[0].port;
console.log(`found unit at ${endpoint}"${port.toString()}`);
}
if (!endpoint) {
throw new Error("invalid controller address");
}
console.log(`connecting to unit ${endpoint}:${port.toString()}...`);
const unit = new index_js_1.Unit(endpoint, port);
await unit.connect();
console.log("...connected.");
const customRequest = new request_js_1.ICRequest();
customRequest.command = "GetParamList";
customRequest.condition = "";
const reqObj = new request_js_1.ICRequestObj();
reqObj.objnam = "ALL";
reqObj.keys = ["OBJTYP", "SUBTYP", "SNAME", "STATUS"];
customRequest.objectList = [reqObj];
console.log("requesting object info...");
const response = await unit.send(customRequest);
console.log("...received.");
console.log();
let objects = response.objectList;
if (argv.onlyToggleable) {
objects = response.objectList?.filter((obj) => obj.params?.STATUS === "ON" || obj.params?.STATUS === "OFF");
}
if (!objects) {
console.error("no objects found");
}
else {
console.log("Found the following objects:");
console.log(`[OBJNM][Type(/Subtype)] "Friendly Name": CURRENT_STATUS`);
console.log("---------------------------------------");
for (const obj of objects
.filter((obj) => obj.params?.SNAME !== "SNAME")
.map((obj) => `[${obj.objnam}][${obj.params?.OBJTYP ?? ""}${obj.params?.SUBTYP !== "SUBTYP" ? `/${obj.params?.SUBTYP ?? ""}` : ""}] "${obj.params?.SNAME ?? ""}": ${obj.params?.STATUS ?? ""}`)) {
console.log(obj);
}
}
unit.close();
};
example().catch((e) => {
throw e;
});
//# sourceMappingURL=list-objects.js.map

1
cjs/list-objects.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"list-objects.js","sourceRoot":"","sources":["../list-objects.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yCAA6C;AAC7C,sDAAgE;AAEhE,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7C,IAAI,QAAQ,GAAG,EAAE,CAAC;AAClB,IAAI,IAAI,GAAG,IAAI,CAAC;AAChB,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,QAA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SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QAEvD,KAAK,MAAM,GAAG,IAAI,OAAO;aACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,KAAK,OAAO,CAAC;aAC9C,GAAG,CACF,CAAC,GAAG,EAAE,EAAE,CACN,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,IAAI,EAAE,EAAE,CACnL,EAAE,CAAC;YACJ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;AACf,CAAC,CAAC;AACF,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;IAC7B,MAAM,CAAC,CAAC;AACV,CAAC,CAAC,CAAC"}

1
esm/list-objects.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export {};

73
esm/list-objects.js Normal file
View File

@ -0,0 +1,73 @@
import minimist from "minimist";
import { FindUnits, Unit } from "./index.js";
import { ICRequest, ICRequestObj } from "./messages/request.js";
const argv = minimist(process.argv.slice(2));
let endpoint = "";
let port = 6680;
if (typeof argv.controllerAddr === "string") {
endpoint = argv.controllerAddr;
}
if (typeof argv.controllerPort === "number") {
port = argv.controllerPort;
}
const example = async () => {
if (!endpoint) {
console.log("searching for units...");
let multicastAddr;
if (typeof argv.multicastAddr === "string") {
multicastAddr = argv.multicastAddr;
}
const finder = new FindUnits(multicastAddr);
const units = await finder.searchAsync(3000);
finder.close();
if (units.length === 0) {
throw new Error("no IntelliCenter units found, exiting.");
}
if (units.length > 1) {
throw new Error(`found more than one IntelliCenter unit, unsure which one to use. ${JSON.stringify(units)}`);
}
endpoint = units[0].addressStr;
port = units[0].port;
console.log(`found unit at ${endpoint}"${port.toString()}`);
}
if (!endpoint) {
throw new Error("invalid controller address");
}
console.log(`connecting to unit ${endpoint}:${port.toString()}...`);
const unit = new Unit(endpoint, port);
await unit.connect();
console.log("...connected.");
const customRequest = new ICRequest();
customRequest.command = "GetParamList";
customRequest.condition = "";
const reqObj = new ICRequestObj();
reqObj.objnam = "ALL";
reqObj.keys = ["OBJTYP", "SUBTYP", "SNAME", "STATUS"];
customRequest.objectList = [reqObj];
console.log("requesting object info...");
const response = await unit.send(customRequest);
console.log("...received.");
console.log();
let objects = response.objectList;
if (argv.onlyToggleable) {
objects = response.objectList?.filter((obj) => obj.params?.STATUS === "ON" || obj.params?.STATUS === "OFF");
}
if (!objects) {
console.error("no objects found");
}
else {
console.log("Found the following objects:");
console.log(`[OBJNM][Type(/Subtype)] "Friendly Name": CURRENT_STATUS`);
console.log("---------------------------------------");
for (const obj of objects
.filter((obj) => obj.params?.SNAME !== "SNAME")
.map((obj) => `[${obj.objnam}][${obj.params?.OBJTYP ?? ""}${obj.params?.SUBTYP !== "SUBTYP" ? `/${obj.params?.SUBTYP ?? ""}` : ""}] "${obj.params?.SNAME ?? ""}": ${obj.params?.STATUS ?? ""}`)) {
console.log(obj);
}
}
unit.close();
};
example().catch((e) => {
throw e;
});
//# sourceMappingURL=list-objects.js.map

1
esm/list-objects.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"file":"list-objects.js","sourceRoot":"","sources":["../list-objects.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EA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AAC"}

93
list-objects.ts Normal file
View File

@ -0,0 +1,93 @@
import minimist from "minimist";
import { FindUnits, Unit } from "./index.js";
import { ICRequest, ICRequestObj } from "./messages/request.js";
const argv = minimist(process.argv.slice(2));
let endpoint = "";
let port = 6680;
if (typeof argv.controllerAddr === "string") {
endpoint = argv.controllerAddr;
}
if (typeof argv.controllerPort === "number") {
port = argv.controllerPort;
}
const example = async () => {
if (!endpoint) {
console.log("searching for units...");
let multicastAddr: string | undefined;
if (typeof argv.multicastAddr === "string") {
multicastAddr = argv.multicastAddr;
}
const finder = new FindUnits(multicastAddr);
const units = await finder.searchAsync(3000);
finder.close();
if (units.length === 0) {
throw new Error("no IntelliCenter units found, exiting.");
}
if (units.length > 1) {
throw new Error(
`found more than one IntelliCenter unit, unsure which one to use. ${JSON.stringify(units)}`,
);
}
endpoint = units[0].addressStr;
port = units[0].port;
console.log(`found unit at ${endpoint}"${port.toString()}`);
}
if (!endpoint) {
throw new Error("invalid controller address");
}
console.log(`connecting to unit ${endpoint}:${port.toString()}...`);
const unit = new Unit(endpoint, port);
await unit.connect();
console.log("...connected.");
const customRequest = new ICRequest();
customRequest.command = "GetParamList";
customRequest.condition = "";
const reqObj = new ICRequestObj();
reqObj.objnam = "ALL";
reqObj.keys = ["OBJTYP", "SUBTYP", "SNAME", "STATUS"];
customRequest.objectList = [reqObj];
console.log("requesting object info...");
const response = await unit.send(customRequest);
console.log("...received.");
console.log();
let objects = response.objectList;
if (argv.onlyToggleable) {
objects = response.objectList?.filter(
(obj) => obj.params?.STATUS === "ON" || obj.params?.STATUS === "OFF",
);
}
if (!objects) {
console.error("no objects found");
} else {
console.log("Found the following objects:");
console.log(`[OBJNM][Type(/Subtype)] "Friendly Name": CURRENT_STATUS`);
console.log("---------------------------------------");
for (const obj of objects
.filter((obj) => obj.params?.SNAME !== "SNAME")
.map(
(obj) =>
`[${obj.objnam}][${obj.params?.OBJTYP ?? ""}${obj.params?.SUBTYP !== "SUBTYP" ? `/${obj.params?.SUBTYP ?? ""}` : ""}] "${obj.params?.SNAME ?? ""}": ${obj.params?.STATUS ?? ""}`,
)) {
console.log(obj);
}
}
unit.close();
};
example().catch((e: unknown) => {
throw e;
});

19
package-lock.json generated
View File

@ -16,10 +16,12 @@
"devDependencies": {
"@eslint/js": "^9.17.0",
"@types/debug": "^4.1.12",
"@types/minimist": "^1.2.5",
"@types/uuid": "^10.0.0",
"@types/ws": "^8.5.13",
"eslint": "^9.17.0",
"markdownlint-cli2": "^0.17.1",
"minimist": "^1.2.8",
"prettier": "3.4.2",
"supports-color": "^10.0.0",
"typescript": "^5.7.2",
@ -304,6 +306,13 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/ms": {
"version": "0.7.34",
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz",
@ -2114,6 +2123,16 @@
"node": "*"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",

View File

@ -76,7 +76,8 @@
"build": "tsc --module commonjs --moduleResolution classic --outDir cjs/ && echo {\"type\": \"commonjs\"} > cjs/package.json && tsc --outDir esm/ && echo {\"type\": \"module\"} > esm/package.json",
"example": "tsc && node esm/example.js",
"lint": "eslint . && prettier . --check && markdownlint-cli2 **/*.md",
"lint:fix": "eslint . --fix && prettier . --write && markdownlint-cli2 --fix **/*.md"
"lint:fix": "eslint . --fix && prettier . --write && markdownlint-cli2 --fix **/*.md",
"list-objects": "tsc && node esm/list-objects.js"
},
"dependencies": {
"debug": "^4.4.0",
@ -86,10 +87,12 @@
"devDependencies": {
"@eslint/js": "^9.17.0",
"@types/debug": "^4.1.12",
"@types/minimist": "^1.2.5",
"@types/uuid": "^10.0.0",
"@types/ws": "^8.5.13",
"eslint": "^9.17.0",
"markdownlint-cli2": "^0.17.1",
"minimist": "^1.2.8",
"prettier": "3.4.2",
"supports-color": "^10.0.0",
"typescript": "^5.7.2",