Skip to content

Commit

Permalink
Add GetCircuitStatus message
Browse files Browse the repository at this point in the history
  • Loading branch information
parnic committed Jan 5, 2025
1 parent abe9ba7 commit 50d71a2
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 4 deletions.
5 changes: 4 additions & 1 deletion dist/example.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/example.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions dist/messages/circuit-status.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ICRequest } from "./request.js";
/**
* Requests the list of circuits known to this controller.
*
* The response contains an `objectList` populated with circuit information.
*
* @returns the object used to issue this request
*/
export declare function GetCircuitStatus(): ICRequest;
37 changes: 37 additions & 0 deletions dist/messages/circuit-status.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/messages/circuit-status.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/messages/messages.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { GetBodyStatus } from "./body-status.js";
import { GetChemicalStatus } from "./chem-status.js";
import { GetCircuitStatus } from "./circuit-status.js";
import { GetSystemConfiguration } from "./configuration.js";
import { GetHeaters } from "./get-heater.js";
import { SubscribeToUpdates } from "./notify.js";
Expand All @@ -11,6 +12,7 @@ import { GetSystemInformation } from "./system-info.js";
export declare const messages: {
GetBodyStatus: typeof GetBodyStatus;
GetChemicalStatus: typeof GetChemicalStatus;
GetCircuitStatus: typeof GetCircuitStatus;
GetHeaters: typeof GetHeaters;
GetSchedule: typeof GetSchedule;
GetSystemConfiguration: typeof GetSystemConfiguration;
Expand Down
2 changes: 2 additions & 0 deletions dist/messages/messages.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/messages/messages.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FindUnits, Unit } from "./index.js";
import { messages } from "./messages/messages.js";

console.log("searching...");
const f = new FindUnits("10.0.0.3");
const f = new FindUnits();
const units = await f.searchAsync(1000);
f.close();
console.log("Discovered units:", units);
Expand Down Expand Up @@ -62,6 +62,10 @@ console.log("sending Get Schedule request...");
resp = await unit.send(messages.GetSchedule());
console.log("got response:", JSON.stringify(resp, null, 2));

console.log("sending Get Circuit Status request...");
resp = await unit.send(messages.GetCircuitStatus());
console.log("got response:", JSON.stringify(resp, null, 2));

// console.log("sending Set Setpoint request...");
// resp = await unit.send(messages.SetSetpoint("B1202", 97));
// console.log("got response:", JSON.stringify(resp, null, 2));
Expand Down
39 changes: 39 additions & 0 deletions messages/circuit-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { GetRequest, ICRequest, ICRequestObj } from "./request.js";

/**
* Requests the list of circuits known to this controller.
*
* The response contains an `objectList` populated with circuit information.
*
* @returns the object used to issue this request
*/
export function GetCircuitStatus(): ICRequest {
const req = GetRequest();
req.command = "GetParamList";
req.condition = "OBJTYP = CIRCUIT";
req.objectList = [];

const reqObj = new ICRequestObj();
reqObj.objnam = "ALL";
reqObj.keys = [
"OBJNAM",
"OBJTYP",
"SUBTYP",
"STATUS",
"BODY",
"SNAME",
"HNAME",
"FREEZE",
"DNTSTP",
"HNAME",
"TIME",
"FEATR",
"USAGE",
"LIMIT",
"USE",
"SHOMNU",
];
req.objectList.push(reqObj);

return req;
}
2 changes: 2 additions & 0 deletions messages/messages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { GetBodyStatus } from "./body-status.js";
import { GetChemicalStatus } from "./chem-status.js";
import { GetCircuitStatus } from "./circuit-status.js";
import { GetSystemConfiguration } from "./configuration.js";
import { GetHeaters } from "./get-heater.js";
import { SubscribeToUpdates } from "./notify.js";
Expand All @@ -12,6 +13,7 @@ import { GetSystemInformation } from "./system-info.js";
export const messages = {
GetBodyStatus,
GetChemicalStatus,
GetCircuitStatus,
GetHeaters,
GetSchedule,
GetSystemConfiguration,
Expand Down

0 comments on commit 50d71a2

Please sign in to comment.