Skip to content

Commit

Permalink
Add messages, cleanup
Browse files Browse the repository at this point in the history
This adds a bunch of messages to retrieve and set various things on the controller. It also groups the messages under one export to simplify the process of using and discovering many of them from one location.

Some of these are WIP/probably not portable to other systems.

This also adds the ability to set multiple circuits at once.
  • Loading branch information
parnic committed Jan 4, 2025
1 parent 7daf47a commit e306a62
Show file tree
Hide file tree
Showing 31 changed files with 425 additions and 57 deletions.
27 changes: 18 additions & 9 deletions 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.

17 changes: 17 additions & 0 deletions dist/messages/chem-status.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { ICRequest } from "./request.js";
/**
* Requests the status of chemical controllers known to this controller.
*
* The response contains the list of chemical controllers available in the `objectList` array.
* For example, an IntelliChem may be one of the entries with `objnam` = `"CHM01"`, `params`.`OBJTYP`
* = `"CHEM"`, `params`.`SUBTYP` = `"ICHEM"` while an IntelliChlor salt cell may be `objnam` = `"CHR01"`,
* `params`.`OBJTYP` = `"CHEM"`, `params`.`SUBTYP` = `"ICHLOR"`. IntelliChlor knows the `"SALT"` level
* while IntelliChem knows the `"PH"` values (PHTNK, PHSET, PHVAL), `"ORP"` values (ORPTNK, ORPSET, ORPVAL),
* `"ALK"` (alkalinity), `"CALC"` (calcium hardness), and `"CYACID"` (cyanuric acid).
*
* pH and ORP Set and Val are in their respective units and orders of magnitude (e.g. 7.6, 750) while the TNK
* levels seem to be on a scale of 1-7 (so "7" would be 100% full).
*
* @returns the object used to issue this request
*/
export declare function GetChemicalStatus(): ICRequest;
30 changes: 30 additions & 0 deletions dist/messages/chem-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/chem-status.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/get-heater.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 heaters known to this controller.
*
* The response contains an `objectList` populated with heater information.
*
* @returns the object used to issue this request
*/
export declare function GetHeaters(): ICRequest;
22 changes: 22 additions & 0 deletions dist/messages/get-heater.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/get-heater.js.map

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

18 changes: 18 additions & 0 deletions dist/messages/messages.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { GetBodyStatus } from "./body-status.js";
import { GetChemicalStatus } from "./chem-status.js";
import { GetSystemConfiguration } from "./configuration.js";
import { GetHeaters } from "./get-heater.js";
import { SetHeatMode } from "./set-heater.js";
import { SetItemStatus } from "./set-status.js";
import { SetSetpoint } from "./setpoint.js";
import { GetSystemInformation } from "./system-info.js";
export declare const messages: {
GetBodyStatus: typeof GetBodyStatus;
GetChemicalStatus: typeof GetChemicalStatus;
GetHeaters: typeof GetHeaters;
GetSystemConfiguration: typeof GetSystemConfiguration;
GetSystemInformation: typeof GetSystemInformation;
SetHeatMode: typeof SetHeatMode;
SetItemStatus: typeof SetItemStatus;
SetSetpoint: typeof SetSetpoint;
};
19 changes: 19 additions & 0 deletions dist/messages/messages.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/messages.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/set-heater.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ICRequest } from "./request.js";
/**
* Requests to turn a body's heater on or off.
*
* This is very WIP. For my pool and my heater configuration, the MODE needs to be 11 to enable my
* heater and 1 to disable all heaters. I have a feeling 11 is unique to my system's configuration,
* but I can't yet determine how to know what 11 maps to in order to make this more generic.
*
* Note that this doesn't necessarily start heating the body by itself - if the body's pump is
* currently off, enabling the heater will not turn it on. If the pump/body is on, then this will
* enable the heater and no further action is required.
*
* @returns the object used to issue this request
*/
export declare function SetHeatMode(bodyObjnam: string, enabled: boolean): ICRequest;
27 changes: 27 additions & 0 deletions dist/messages/set-heater.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/set-heater.js.map

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

11 changes: 3 additions & 8 deletions dist/messages/set-status.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { ICRequest } from "./request.js";
/**
* Requests the status of bodies known to this controller.
* Requests to change the status of items 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.
* Turns one or more items on or off. Use the `objnam` of the circuit to be set.
*
* @returns the object used to issue this request
*/
export declare function SetItemStatus(item: string, status: boolean): ICRequest;
export declare function SetItemStatus(item: string | string[], status: boolean): ICRequest;
28 changes: 16 additions & 12 deletions dist/messages/set-status.js

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

Loading

0 comments on commit e306a62

Please sign in to comment.