mirror of
https://github.com/parnic/node-intellicenter.git
synced 2025-06-16 18:20:14 -05:00
Rename Item to Object
The API all calls these objects so best to go with the flow. This is a breaking change.
This commit is contained in:
4
dist/example.js
vendored
4
dist/example.js
vendored
@ -48,10 +48,10 @@ console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
// resp = await unit.send(messages.SetSetpoint("B1202", 97));
|
||||
// console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
// console.log("turning off pool...");
|
||||
// resp = await unit.send(messages.SetItemStatus("B1101", false));
|
||||
// resp = await unit.send(messages.SetObjectStatus("B1101", false));
|
||||
// console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
// console.log("turning off water feature...");
|
||||
// resp = await unit.send(messages.SetItemStatus("C0003", false));
|
||||
// resp = await unit.send(messages.SetObjectStatus("C0003", false));
|
||||
// console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
// console.log("sending Set Heatmode request...");
|
||||
// resp = await unit.send(messages.SetHeatMode("B1202", true));
|
||||
|
2
dist/example.js.map
vendored
2
dist/example.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"example.js","sourceRoot":"","sources":["../example.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAC5B,MAAM,CAAC,GAAG,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC,CAAC,KAAK,EAAE,CAAC;AACV,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;AAExC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IACvB,MAAM,IAAI,KAAK,CAAC,wCAAw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ist/messages/configuration.d.ts
vendored
@ -3,12 +3,12 @@ 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.
|
||||
* Each object has an `objnam` that should be used to reference that object for future requests,
|
||||
* and `params`.`SNAME` is the user-entered friendly name that can be displayed for the object.
|
||||
* `params`.`OBJTYP` will be either BODY or CIRCUIT depending on the object 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.
|
||||
* Some objects, such as the Pool body, will have the `params`.`OBJLIST` array populated with
|
||||
* a series of attached objects such as a chlorinator device.
|
||||
*
|
||||
* @returns the object used to issue this request
|
||||
*/
|
||||
|
10
dist/messages/configuration.js
vendored
10
dist/messages/configuration.js
vendored
@ -3,12 +3,12 @@ import { GetRequest } 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.
|
||||
* Each object has an `objnam` that should be used to reference that object for future requests,
|
||||
* and `params`.`SNAME` is the user-entered friendly name that can be displayed for the object.
|
||||
* `params`.`OBJTYP` will be either BODY or CIRCUIT depending on the object 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.
|
||||
* Some objects, such as the Pool body, will have the `params`.`OBJLIST` array populated with
|
||||
* a series of attached objects such as a chlorinator device.
|
||||
*
|
||||
* @returns the object used to issue this request
|
||||
*/
|
||||
|
4
dist/messages/messages.d.ts
vendored
4
dist/messages/messages.d.ts
vendored
@ -5,7 +5,7 @@ import { GetHeaters } from "./get-heater.js";
|
||||
import { SubscribeToUpdates } from "./notify.js";
|
||||
import { GetSchedule } from "./schedule.js";
|
||||
import { SetHeatMode } from "./set-heater.js";
|
||||
import { SetItemStatus } from "./set-status.js";
|
||||
import { SetObjectStatus } from "./set-object-status.js";
|
||||
import { SetSetpoint } from "./setpoint.js";
|
||||
import { GetSystemInformation } from "./system-info.js";
|
||||
export declare const messages: {
|
||||
@ -16,7 +16,7 @@ export declare const messages: {
|
||||
GetSystemConfiguration: typeof GetSystemConfiguration;
|
||||
GetSystemInformation: typeof GetSystemInformation;
|
||||
SetHeatMode: typeof SetHeatMode;
|
||||
SetItemStatus: typeof SetItemStatus;
|
||||
SetObjectStatus: typeof SetObjectStatus;
|
||||
SetSetpoint: typeof SetSetpoint;
|
||||
SubscribeToUpdates: typeof SubscribeToUpdates;
|
||||
};
|
||||
|
4
dist/messages/messages.js
vendored
4
dist/messages/messages.js
vendored
@ -5,7 +5,7 @@ import { GetHeaters } from "./get-heater.js";
|
||||
import { SubscribeToUpdates } from "./notify.js";
|
||||
import { GetSchedule } from "./schedule.js";
|
||||
import { SetHeatMode } from "./set-heater.js";
|
||||
import { SetItemStatus } from "./set-status.js";
|
||||
import { SetObjectStatus } from "./set-object-status.js";
|
||||
import { SetSetpoint } from "./setpoint.js";
|
||||
import { GetSystemInformation } from "./system-info.js";
|
||||
export const messages = {
|
||||
@ -16,7 +16,7 @@ export const messages = {
|
||||
GetSystemConfiguration,
|
||||
GetSystemInformation,
|
||||
SetHeatMode,
|
||||
SetItemStatus,
|
||||
SetObjectStatus,
|
||||
SetSetpoint,
|
||||
SubscribeToUpdates,
|
||||
};
|
||||
|
2
dist/messages/messages.js.map
vendored
2
dist/messages/messages.js.map
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../messages/messages.ts"],"names":[],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AO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,aAAa;IACb,iBAAiB;IACjB,UAAU;IACV,WAAW;IACX,sBAAsB;IACtB,oBAAoB;IACpB,WAAW;IACX,eAAe;IACf,WAAW;IACX,kBAAkB;CACnB,CAAC"}
|
9
dist/messages/set-object-status.d.ts
vendored
Normal file
9
dist/messages/set-object-status.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { ICRequest } from "./request.js";
|
||||
/**
|
||||
* Requests to change the status of objects known to this controller.
|
||||
*
|
||||
* Turns one or more objects on or off. Use the `objnam` of the circuit to be set.
|
||||
*
|
||||
* @returns the object used to issue this request
|
||||
*/
|
||||
export declare function SetObjectStatus(object: string | string[], status: boolean): ICRequest;
|
@ -1,24 +1,24 @@
|
||||
import { ICParam } from "./param.js";
|
||||
import { GetRequest, ICRequestObj } from "./request.js";
|
||||
/**
|
||||
* Requests to change the status of items known to this controller.
|
||||
* Requests to change the status of objects known to this controller.
|
||||
*
|
||||
* Turns one or more items on or off. Use the `objnam` of the circuit to be set.
|
||||
* Turns one or more objects on or off. Use the `objnam` of the circuit to be set.
|
||||
*
|
||||
* @returns the object used to issue this request
|
||||
*/
|
||||
export function SetItemStatus(item, status) {
|
||||
export function SetObjectStatus(object, status) {
|
||||
const req = GetRequest();
|
||||
req.command = "SetParamList";
|
||||
req.objectList = [];
|
||||
let items;
|
||||
if (Array.isArray(item)) {
|
||||
items = item;
|
||||
let objects;
|
||||
if (Array.isArray(object)) {
|
||||
objects = object;
|
||||
}
|
||||
else {
|
||||
items = [item];
|
||||
objects = [object];
|
||||
}
|
||||
for (const i of items) {
|
||||
for (const i of objects) {
|
||||
const reqObj = new ICRequestObj();
|
||||
reqObj.objnam = i;
|
||||
reqObj.params = new ICParam();
|
||||
@ -27,4 +27,4 @@ export function SetItemStatus(item, status) {
|
||||
}
|
||||
return req;
|
||||
}
|
||||
//# sourceMappingURL=set-status.js.map
|
||||
//# sourceMappingURL=set-object-status.js.map
|
1
dist/messages/set-object-status.js.map
vendored
Normal file
1
dist/messages/set-object-status.js.map
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"set-object-status.js","sourceRoot":"","sources":["../../messages/set-object-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAa,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAyB,EACzB,MAAe;IAEf,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IACzB,GAAG,CAAC,OAAO,GAAG,cAAc,CAAC;IAC7B,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC;IAEpB,IAAI,OAAiB,CAAC;IACtB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClB,MAAM,CAAC,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7C,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
9
dist/messages/set-status.d.ts
vendored
9
dist/messages/set-status.d.ts
vendored
@ -1,9 +0,0 @@
|
||||
import { ICRequest } from "./request.js";
|
||||
/**
|
||||
* Requests to change the status of items known to this controller.
|
||||
*
|
||||
* 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 | string[], status: boolean): ICRequest;
|
1
dist/messages/set-status.js.map
vendored
1
dist/messages/set-status.js.map
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"set-status.js","sourceRoot":"","sources":["../../messages/set-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAa,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAuB,EACvB,MAAe;IAEf,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;IACzB,GAAG,CAAC,OAAO,GAAG,cAAc,CAAC;IAC7B,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC;IAEpB,IAAI,KAAe,CAAC;IACpB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,KAAK,GAAG,IAAI,CAAC;IACf,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAClB,MAAM,CAAC,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QAC7C,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
@ -67,11 +67,11 @@ console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
// console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
|
||||
// console.log("turning off pool...");
|
||||
// resp = await unit.send(messages.SetItemStatus("B1101", false));
|
||||
// resp = await unit.send(messages.SetObjectStatus("B1101", false));
|
||||
// console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
|
||||
// console.log("turning off water feature...");
|
||||
// resp = await unit.send(messages.SetItemStatus("C0003", false));
|
||||
// resp = await unit.send(messages.SetObjectStatus("C0003", false));
|
||||
// console.log("got response:", JSON.stringify(resp, null, 2));
|
||||
|
||||
// console.log("sending Set Heatmode request...");
|
||||
|
@ -4,12 +4,12 @@ import { GetRequest, 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.
|
||||
* Each object has an `objnam` that should be used to reference that object for future requests,
|
||||
* and `params`.`SNAME` is the user-entered friendly name that can be displayed for the object.
|
||||
* `params`.`OBJTYP` will be either BODY or CIRCUIT depending on the object 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.
|
||||
* Some objects, such as the Pool body, will have the `params`.`OBJLIST` array populated with
|
||||
* a series of attached objects such as a chlorinator device.
|
||||
*
|
||||
* @returns the object used to issue this request
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@ import { GetHeaters } from "./get-heater.js";
|
||||
import { SubscribeToUpdates } from "./notify.js";
|
||||
import { GetSchedule } from "./schedule.js";
|
||||
import { SetHeatMode } from "./set-heater.js";
|
||||
import { SetItemStatus } from "./set-status.js";
|
||||
import { SetObjectStatus } from "./set-object-status.js";
|
||||
import { SetSetpoint } from "./setpoint.js";
|
||||
import { GetSystemInformation } from "./system-info.js";
|
||||
|
||||
@ -17,7 +17,7 @@ export const messages = {
|
||||
GetSystemConfiguration,
|
||||
GetSystemInformation,
|
||||
SetHeatMode,
|
||||
SetItemStatus,
|
||||
SetObjectStatus,
|
||||
SetSetpoint,
|
||||
SubscribeToUpdates,
|
||||
};
|
||||
|
@ -2,28 +2,28 @@ import { ICParam } from "./param.js";
|
||||
import { GetRequest, ICRequest, ICRequestObj } from "./request.js";
|
||||
|
||||
/**
|
||||
* Requests to change the status of items known to this controller.
|
||||
* Requests to change the status of objects known to this controller.
|
||||
*
|
||||
* Turns one or more items on or off. Use the `objnam` of the circuit to be set.
|
||||
* Turns one or more objects on or off. Use the `objnam` of the circuit to be set.
|
||||
*
|
||||
* @returns the object used to issue this request
|
||||
*/
|
||||
export function SetItemStatus(
|
||||
item: string | string[],
|
||||
export function SetObjectStatus(
|
||||
object: string | string[],
|
||||
status: boolean,
|
||||
): ICRequest {
|
||||
const req = GetRequest();
|
||||
req.command = "SetParamList";
|
||||
req.objectList = [];
|
||||
|
||||
let items: string[];
|
||||
if (Array.isArray(item)) {
|
||||
items = item;
|
||||
let objects: string[];
|
||||
if (Array.isArray(object)) {
|
||||
objects = object;
|
||||
} else {
|
||||
items = [item];
|
||||
objects = [object];
|
||||
}
|
||||
|
||||
for (const i of items) {
|
||||
for (const i of objects) {
|
||||
const reqObj = new ICRequestObj();
|
||||
reqObj.objnam = i;
|
||||
reqObj.params = new ICParam();
|
Reference in New Issue
Block a user