Skip to content

Commit

Permalink
Fleshing out more messages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
parnic committed Jan 3, 2025
1 parent ceb9299 commit 7daf47a
Show file tree
Hide file tree
Showing 32 changed files with 634 additions and 391 deletions.
2 changes: 2 additions & 0 deletions connection-logs/turn-body-on.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[OUTGOING] {"command":"SetParamList","objectList":[{"objnam":"B1101","params":{"STATUS":"ON"}}],"messageID":"B1101"}
[INCOMING] {"command":"SetParamList","messageID":"B1101","response":"200"}
20 changes: 19 additions & 1 deletion dist/index.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/index.js.map

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

14 changes: 14 additions & 0 deletions dist/messages/body-status.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ICRequest } 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 declare function GetBodyStatus(): ICRequest;
27 changes: 27 additions & 0 deletions dist/messages/body-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/body-status.js.map

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

15 changes: 15 additions & 0 deletions dist/messages/configuration.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { 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 declare function GetSystemConfiguration(): ICRequest;
22 changes: 22 additions & 0 deletions dist/messages/configuration.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/configuration.js.map

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

123 changes: 123 additions & 0 deletions dist/messages/param.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
export declare class ICParam {
ABSMAX?: string;
ABSMIN?: string;
ACT?: string;
ACT1?: string;
ACT2?: string;
ACT3?: string;
ACT4?: string;
ADDRESS?: string;
ALK?: string;
AVAIL?: "AVAIL" | "ON" | "OFF";
BADGE?: string;
BODY?: string;
BOOST?: string;
CALC?: string;
CALIB?: string;
CHILD?: string;
CIRCUIT?: string;
CITY?: string;
CLK24A?: string;
COMUART?: string;
COOL?: string;
COUNT?: string;
COUNTRY?: string;
CYACID?: string;
DAY?: string;
DLSTIM?: "DLSTIM" | "ON" | "OFF";
DLY?: string;
DNTSTP?: string;
EMAIL?: string;
EMAIL2?: string;
ENABLE?: "ENABLE" | "ON" | "OFF";
FEATR?: string;
FILTER?: string;
FREEZE?: string;
GPM?: string;
HEATER?: string;
HEATING?: "HEATING" | "ON" | "OFF";
HITMP?: string;
HNAME?: string;
HTMODE?: string;
HTSRC?: string;
IN?: string;
LIMIT?: string;
LISTORD?: string;
LOCX?: string;
LOCY?: string;
LOTMP?: string;
LSTTMP?: string;
MANHT?: "MANHT" | "ON" | "OFF";
MANOVR?: "MANOVR" | "ON" | "OFF";
MANUAL?: string;
MAX?: string;
MAXF?: string;
MIN?: string;
MINF?: string;
MODE?: string;
NAME?: string;
OBJLIST?: ICParam[];
OBJNAM?: string;
OBJTYP?: string;
OFFSET?: string;
ORPSET?: string;
ORPTNK?: string;
ORPVAL?: string;
PARENT?: string;
PARTY?: string;
PASSWRD?: string;
PERMIT?: string;
PHONE?: string;
PHONE2?: string;
PHSET?: string;
PHTNK?: string;
PHVAL?: string;
PRIM?: string;
PRIMFLO?: string;
PRIMTIM?: string;
PRIOR?: string;
PROBE?: string;
PROPNAME?: string;
PWR?: string;
QUALTY?: string;
READY?: string;
RLY?: string;
RPM?: string;
SALT?: string;
SEC?: string;
SELECT?: string;
SERVICE?: "SERVICE" | "AUTO" | "TIMEOUT";
SETTMP?: string;
SETTMPNC?: string;
SHARE?: string;
SHOMNU?: string;
SINDEX?: string;
SNAME?: string;
SOURCE?: string;
SPEED?: string;
SRIS?: string;
SSET?: string;
START?: string;
STATE?: string;
STATIC?: string;
STATUS?: "STATUS" | "ON" | "OFF";
STOP?: string;
SUBTYP?: string;
SUPER?: "SUPER" | "ON" | "OFF";
SWIM?: string;
SYNC?: string;
SYSTIM?: string;
TEMP?: string;
TIME?: string;
TIMOUT?: string;
TIMZON?: string;
UPDATE?: string;
USAGE?: string;
USE?: string;
VACFLO?: "VACFLO" | "ON" | "OFF";
VACTIM?: "VACTIM" | "ON" | "OFF";
VALVE?: "VALVE" | "ON" | "OFF";
VER?: string;
VOL?: string;
ZIP?: string;
}
125 changes: 125 additions & 0 deletions dist/messages/param.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/param.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/request.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ICParam } from "./param.js";
export declare class ICRequestObj {
objnam: string;
keys: string[];
params?: ICParam;
}
export declare class ICRequest {
condition?: string;
Expand Down
Loading

0 comments on commit 7daf47a

Please sign in to comment.