@xyo-network/pentair-plugin 2.75.15 → 2.75.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/docs.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "fileName": "plugins/packages/payloadset/packages/pentair/src/index.ts",
17
17
  "line": 8,
18
18
  "character": 0,
19
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/index.ts#L8"
19
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/index.ts#L8"
20
20
  }
21
21
  ],
22
22
  "target": 1
@@ -1591,7 +1591,7 @@
1591
1591
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
1592
1592
  "line": 13,
1593
1593
  "character": 2,
1594
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
1594
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
1595
1595
  }
1596
1596
  ],
1597
1597
  "type": {
@@ -1613,7 +1613,7 @@
1613
1613
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
1614
1614
  "line": 12,
1615
1615
  "character": 60,
1616
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
1616
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
1617
1617
  }
1618
1618
  ]
1619
1619
  }
@@ -3383,7 +3383,7 @@
3383
3383
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
3384
3384
  "line": 13,
3385
3385
  "character": 2,
3386
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
3386
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
3387
3387
  }
3388
3388
  ],
3389
3389
  "type": {
@@ -3405,7 +3405,7 @@
3405
3405
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
3406
3406
  "line": 12,
3407
3407
  "character": 60,
3408
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
3408
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
3409
3409
  }
3410
3410
  ]
3411
3411
  }
@@ -4472,7 +4472,7 @@
4472
4472
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
4473
4473
  "line": 21,
4474
4474
  "character": 18,
4475
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L21"
4475
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L21"
4476
4476
  }
4477
4477
  ],
4478
4478
  "type": {
@@ -9546,7 +9546,7 @@
9546
9546
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
9547
9547
  "line": 23,
9548
9548
  "character": 27,
9549
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L23"
9549
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L23"
9550
9550
  }
9551
9551
  ],
9552
9552
  "signatures": [
@@ -9561,7 +9561,7 @@
9561
9561
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
9562
9562
  "line": 23,
9563
9563
  "character": 27,
9564
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L23"
9564
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L23"
9565
9565
  }
9566
9566
  ],
9567
9567
  "parameters": [
@@ -18065,7 +18065,7 @@
18065
18065
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18066
18066
  "line": 18,
18067
18067
  "character": 13,
18068
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L18"
18068
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L18"
18069
18069
  }
18070
18070
  ],
18071
18071
  "typeParameters": [
@@ -18120,7 +18120,7 @@
18120
18120
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18121
18121
  "line": 12,
18122
18122
  "character": 12,
18123
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
18123
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
18124
18124
  }
18125
18125
  ],
18126
18126
  "type": {
@@ -18150,7 +18150,7 @@
18150
18150
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18151
18151
  "line": 13,
18152
18152
  "character": 2,
18153
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
18153
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
18154
18154
  }
18155
18155
  ],
18156
18156
  "type": {
@@ -18174,7 +18174,7 @@
18174
18174
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18175
18175
  "line": 12,
18176
18176
  "character": 60,
18177
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
18177
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
18178
18178
  }
18179
18179
  ]
18180
18180
  }
@@ -18195,13 +18195,13 @@
18195
18195
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18196
18196
  "line": 9,
18197
18197
  "character": 12,
18198
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L9"
18198
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L9"
18199
18199
  },
18200
18200
  {
18201
18201
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18202
18202
  "line": 10,
18203
18203
  "character": 13,
18204
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L10"
18204
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L10"
18205
18205
  }
18206
18206
  ],
18207
18207
  "type": {
@@ -18220,7 +18220,7 @@
18220
18220
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18221
18221
  "line": 16,
18222
18222
  "character": 12,
18223
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L16"
18223
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L16"
18224
18224
  }
18225
18225
  ],
18226
18226
  "type": {
@@ -18263,13 +18263,13 @@
18263
18263
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18264
18264
  "line": 9,
18265
18265
  "character": 12,
18266
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L9"
18266
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L9"
18267
18267
  },
18268
18268
  {
18269
18269
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
18270
18270
  "line": 10,
18271
18271
  "character": 13,
18272
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L10"
18272
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L10"
18273
18273
  }
18274
18274
  ],
18275
18275
  "type": {
@@ -18288,7 +18288,7 @@
18288
18288
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Plugin.ts",
18289
18289
  "line": 7,
18290
18290
  "character": 13,
18291
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Plugin.ts#L7"
18291
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Plugin.ts#L7"
18292
18292
  }
18293
18293
  ],
18294
18294
  "signatures": [
@@ -18303,7 +18303,7 @@
18303
18303
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Plugin.ts",
18304
18304
  "line": 7,
18305
18305
  "character": 40,
18306
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Plugin.ts#L7"
18306
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Plugin.ts#L7"
18307
18307
  }
18308
18308
  ],
18309
18309
  "type": {
@@ -19846,7 +19846,7 @@
19846
19846
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
19847
19847
  "line": 13,
19848
19848
  "character": 2,
19849
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
19849
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L13"
19850
19850
  }
19851
19851
  ],
19852
19852
  "type": {
@@ -19868,7 +19868,7 @@
19868
19868
  "fileName": "plugins/packages/payloadset/packages/pentair/src/Witness.ts",
19869
19869
  "line": 12,
19870
19870
  "character": 60,
19871
- "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/329e1cefafe53/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
19871
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/blob/88daee906ba30/packages/plugins/packages/payloadset/packages/pentair/src/Witness.ts#L12"
19872
19872
  }
19873
19873
  ]
19874
19874
  }
package/package.json CHANGED
@@ -10,21 +10,21 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^2.12.22",
14
- "@xyo-network/abstract-witness": "~2.75.15",
15
- "@xyo-network/module-model": "~2.75.15",
16
- "@xyo-network/payload-model": "~2.75.15",
17
- "@xyo-network/payloadset-plugin": "~2.75.15",
18
- "@xyo-network/pentair-payload-plugin": "~2.75.15",
19
- "@xyo-network/witness-model": "~2.75.15",
13
+ "@xylabs/assert": "^2.12.24",
14
+ "@xyo-network/abstract-witness": "~2.75.17",
15
+ "@xyo-network/module-model": "~2.75.17",
16
+ "@xyo-network/payload-model": "~2.75.17",
17
+ "@xyo-network/payloadset-plugin": "~2.75.17",
18
+ "@xyo-network/pentair-payload-plugin": "~2.75.17",
19
+ "@xyo-network/witness-model": "~2.75.17",
20
20
  "node-screenlogic": "^2.0.0"
21
21
  },
22
22
  "devDependencies": {
23
- "@xylabs/jest-helpers": "^2.12.22",
24
- "@xylabs/ts-scripts-yarn3": "^3.0.88",
25
- "@xylabs/tsconfig": "^3.0.88",
26
- "@xyo-network/account": "~2.75.15",
27
- "@xyo-network/payload-wrapper": "~2.75.15",
23
+ "@xylabs/jest-helpers": "^2.12.24",
24
+ "@xylabs/ts-scripts-yarn3": "^3.1.9",
25
+ "@xylabs/tsconfig": "^3.1.9",
26
+ "@xyo-network/account": "~2.75.17",
27
+ "@xyo-network/payload-wrapper": "~2.75.17",
28
28
  "jest": "^29.7.0",
29
29
  "typescript": "^5.2.2"
30
30
  },
@@ -71,5 +71,5 @@
71
71
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
72
72
  },
73
73
  "sideEffects": false,
74
- "version": "2.75.15"
74
+ "version": "2.75.17"
75
75
  }
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/Plugin.ts
21
- var Plugin_exports = {};
22
- __export(Plugin_exports, {
23
- PentairScreenlogicPlugin: () => PentairScreenlogicPlugin
24
- });
25
- module.exports = __toCommonJS(Plugin_exports);
26
- var import_payload_model = require("@xyo-network/payload-model");
27
- var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
28
- var import_pentair_payload_plugin2 = require("@xyo-network/pentair-payload-plugin");
29
-
30
- // src/Witness.ts
31
- var import_assert = require("@xylabs/assert");
32
- var import_abstract_witness = require("@xyo-network/abstract-witness");
33
- var import_pentair_payload_plugin = require("@xyo-network/pentair-payload-plugin");
34
- var import_node_screenlogic = require("node-screenlogic");
35
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
36
- var PentairScreenlogicWitness = class extends import_abstract_witness.AbstractWitness {
37
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
38
- async observeHandler(_payloads) {
39
- const finder = new import_node_screenlogic.FindUnits();
40
- const localUnit = (0, import_assert.assertEx)((await finder.searchAsync()).shift(), "No local screenlogic unit found");
41
- import_node_screenlogic.screenlogic.initUnit(localUnit);
42
- (0, import_assert.assertEx)(await import_node_screenlogic.screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
43
- return [
44
- {
45
- chem: await import_node_screenlogic.screenlogic.chem.getChemicalDataAsync(),
46
- chlor: await import_node_screenlogic.screenlogic.chlor.getIntellichlorConfigAsync(),
47
- equipment: {
48
- circuitNames: await import_node_screenlogic.screenlogic.equipment.getAllCircuitNamesAsync(),
49
- config: await import_node_screenlogic.screenlogic.equipment.getEquipmentConfigurationAsync(),
50
- controllerConfig: await import_node_screenlogic.screenlogic.equipment.getControllerConfigAsync(),
51
- customNames: await import_node_screenlogic.screenlogic.equipment.getCustomNamesAsync(),
52
- state: await import_node_screenlogic.screenlogic.equipment.getEquipmentStateAsync(),
53
- systemTime: await import_node_screenlogic.screenlogic.equipment.getSystemTimeAsync(),
54
- weatherForecast: await import_node_screenlogic.screenlogic.equipment.getWeatherForecastAsync()
55
- },
56
- schedule: {
57
- once: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RUNONCE),
58
- recurring: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RECURRING)
59
- },
60
- schema: import_pentair_payload_plugin.PentairScreenlogicSchema,
61
- version: await import_node_screenlogic.screenlogic.getVersionAsync()
62
- }
63
- ];
64
- }
65
- };
66
-
67
- // src/Plugin.ts
68
- var PentairScreenlogicPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
69
- { required: { [import_pentair_payload_plugin2.PentairScreenlogicSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
70
- {
71
- witness: async (params) => {
72
- const result = await PentairScreenlogicWitness.create(params);
73
- return result;
74
- }
75
- }
76
- );
77
- //# sourceMappingURL=Plugin.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\nimport { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\n\nimport { PentairScreenlogicWitness } from './Witness'\n\nexport const PentairScreenlogicPlugin = () =>\n createPayloadSetWitnessPlugin<PentairScreenlogicWitness>(\n { required: { [PentairScreenlogicSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await PentairScreenlogicWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAiC;AACjC,+BAA8C;AAC9C,IAAAA,iCAAyC;;;ACFzC,oBAAyB;AACzB,8BAAgC;AAGhC,oCAAoE;AAEpE,8BAAmD;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,kCAAU;AAC7B,UAAM,gBAAY,yBAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,wCAAY,SAAS,SAAS;AAC9B,gCAAS,MAAM,oCAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,oCAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,oCAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,oCAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,oCAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,oCAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,oCAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,oCAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,oCAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,oCAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,OAAO;AAAA,UACxE,WAAW,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,oCAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;;;AD5CO,IAAM,2BAA2B,UACtC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,uDAAwB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACxE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,0BAA0B,OAAO,MAAM;AAC5D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_pentair_payload_plugin"]}
@@ -1,56 +0,0 @@
1
- // src/Plugin.ts
2
- import { PayloadSetSchema } from "@xyo-network/payload-model";
3
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
4
- import { PentairScreenlogicSchema as PentairScreenlogicSchema2 } from "@xyo-network/pentair-payload-plugin";
5
-
6
- // src/Witness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { AbstractWitness } from "@xyo-network/abstract-witness";
9
- import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
10
- import { FindUnits, SchedTypes, screenlogic } from "node-screenlogic";
11
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
12
- var PentairScreenlogicWitness = class extends AbstractWitness {
13
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
14
- async observeHandler(_payloads) {
15
- const finder = new FindUnits();
16
- const localUnit = assertEx((await finder.searchAsync()).shift(), "No local screenlogic unit found");
17
- screenlogic.initUnit(localUnit);
18
- assertEx(await screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
19
- return [
20
- {
21
- chem: await screenlogic.chem.getChemicalDataAsync(),
22
- chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),
23
- equipment: {
24
- circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),
25
- config: await screenlogic.equipment.getEquipmentConfigurationAsync(),
26
- controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),
27
- customNames: await screenlogic.equipment.getCustomNamesAsync(),
28
- state: await screenlogic.equipment.getEquipmentStateAsync(),
29
- systemTime: await screenlogic.equipment.getSystemTimeAsync(),
30
- weatherForecast: await screenlogic.equipment.getWeatherForecastAsync()
31
- },
32
- schedule: {
33
- once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),
34
- recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING)
35
- },
36
- schema: PentairScreenlogicSchema,
37
- version: await screenlogic.getVersionAsync()
38
- }
39
- ];
40
- }
41
- };
42
-
43
- // src/Plugin.ts
44
- var PentairScreenlogicPlugin = () => createPayloadSetWitnessPlugin(
45
- { required: { [PentairScreenlogicSchema2]: 1 }, schema: PayloadSetSchema },
46
- {
47
- witness: async (params) => {
48
- const result = await PentairScreenlogicWitness.create(params);
49
- return result;
50
- }
51
- }
52
- );
53
- export {
54
- PentairScreenlogicPlugin
55
- };
56
- //# sourceMappingURL=Plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\nimport { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\n\nimport { PentairScreenlogicWitness } from './Witness'\n\nexport const PentairScreenlogicPlugin = () =>\n createPayloadSetWitnessPlugin<PentairScreenlogicWitness>(\n { required: { [PentairScreenlogicSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await PentairScreenlogicWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";AAAA,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAC9C,SAAS,4BAAAA,iCAAgC;;;ACFzC,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAGhC,SAAoC,gCAAgC;AAEpE,SAAS,WAAW,YAAY,mBAAmB;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,UAAU;AAC7B,UAAM,YAAY,UAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,gBAAY,SAAS,SAAS;AAC9B,aAAS,MAAM,YAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,YAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,YAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,YAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,YAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,YAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,YAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,YAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,YAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,YAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,YAAY,SAAS,qBAAqB,WAAW,OAAO;AAAA,UACxE,WAAW,MAAM,YAAY,SAAS,qBAAqB,WAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,YAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;;;AD5CO,IAAM,2BAA2B,MACtC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,yBAAwB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACxE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,0BAA0B,OAAO,MAAM;AAC5D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["PentairScreenlogicSchema","PentairScreenlogicSchema"]}
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/Witness.ts
21
- var Witness_exports = {};
22
- __export(Witness_exports, {
23
- PentairScreenlogicWitness: () => PentairScreenlogicWitness,
24
- PentairScreenlogicWitnessConfigSchema: () => PentairScreenlogicWitnessConfigSchema
25
- });
26
- module.exports = __toCommonJS(Witness_exports);
27
- var import_assert = require("@xylabs/assert");
28
- var import_abstract_witness = require("@xyo-network/abstract-witness");
29
- var import_pentair_payload_plugin = require("@xyo-network/pentair-payload-plugin");
30
- var import_node_screenlogic = require("node-screenlogic");
31
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
32
- var PentairScreenlogicWitness = class extends import_abstract_witness.AbstractWitness {
33
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
34
- async observeHandler(_payloads) {
35
- const finder = new import_node_screenlogic.FindUnits();
36
- const localUnit = (0, import_assert.assertEx)((await finder.searchAsync()).shift(), "No local screenlogic unit found");
37
- import_node_screenlogic.screenlogic.initUnit(localUnit);
38
- (0, import_assert.assertEx)(await import_node_screenlogic.screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
39
- return [
40
- {
41
- chem: await import_node_screenlogic.screenlogic.chem.getChemicalDataAsync(),
42
- chlor: await import_node_screenlogic.screenlogic.chlor.getIntellichlorConfigAsync(),
43
- equipment: {
44
- circuitNames: await import_node_screenlogic.screenlogic.equipment.getAllCircuitNamesAsync(),
45
- config: await import_node_screenlogic.screenlogic.equipment.getEquipmentConfigurationAsync(),
46
- controllerConfig: await import_node_screenlogic.screenlogic.equipment.getControllerConfigAsync(),
47
- customNames: await import_node_screenlogic.screenlogic.equipment.getCustomNamesAsync(),
48
- state: await import_node_screenlogic.screenlogic.equipment.getEquipmentStateAsync(),
49
- systemTime: await import_node_screenlogic.screenlogic.equipment.getSystemTimeAsync(),
50
- weatherForecast: await import_node_screenlogic.screenlogic.equipment.getWeatherForecastAsync()
51
- },
52
- schedule: {
53
- once: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RUNONCE),
54
- recurring: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RECURRING)
55
- },
56
- schema: import_pentair_payload_plugin.PentairScreenlogicSchema,
57
- version: await import_node_screenlogic.screenlogic.getVersionAsync()
58
- }
59
- ];
60
- }
61
- };
62
- //# sourceMappingURL=Witness.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,8BAAgC;AAGhC,oCAAoE;AAEpE,8BAAmD;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,kCAAU;AAC7B,UAAM,gBAAY,yBAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,wCAAY,SAAS,SAAS;AAC9B,gCAAS,MAAM,oCAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,oCAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,oCAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,oCAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,oCAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,oCAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,oCAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,oCAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,oCAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,oCAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,OAAO;AAAA,UACxE,WAAW,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,oCAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,41 +0,0 @@
1
- // src/Witness.ts
2
- import { assertEx } from "@xylabs/assert";
3
- import { AbstractWitness } from "@xyo-network/abstract-witness";
4
- import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
5
- import { FindUnits, SchedTypes, screenlogic } from "node-screenlogic";
6
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
7
- var PentairScreenlogicWitness = class extends AbstractWitness {
8
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
9
- async observeHandler(_payloads) {
10
- const finder = new FindUnits();
11
- const localUnit = assertEx((await finder.searchAsync()).shift(), "No local screenlogic unit found");
12
- screenlogic.initUnit(localUnit);
13
- assertEx(await screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
14
- return [
15
- {
16
- chem: await screenlogic.chem.getChemicalDataAsync(),
17
- chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),
18
- equipment: {
19
- circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),
20
- config: await screenlogic.equipment.getEquipmentConfigurationAsync(),
21
- controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),
22
- customNames: await screenlogic.equipment.getCustomNamesAsync(),
23
- state: await screenlogic.equipment.getEquipmentStateAsync(),
24
- systemTime: await screenlogic.equipment.getSystemTimeAsync(),
25
- weatherForecast: await screenlogic.equipment.getWeatherForecastAsync()
26
- },
27
- schedule: {
28
- once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),
29
- recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING)
30
- },
31
- schema: PentairScreenlogicSchema,
32
- version: await screenlogic.getVersionAsync()
33
- }
34
- ];
35
- }
36
- };
37
- export {
38
- PentairScreenlogicWitness,
39
- PentairScreenlogicWitnessConfigSchema
40
- };
41
- //# sourceMappingURL=Witness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAGhC,SAAoC,gCAAgC;AAEpE,SAAS,WAAW,YAAY,mBAAmB;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,UAAU;AAC7B,UAAM,YAAY,UAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,gBAAY,SAAS,SAAS;AAC9B,aAAS,MAAM,YAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,YAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,YAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,YAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,YAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,YAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,YAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,YAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,YAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,YAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,YAAY,SAAS,qBAAqB,WAAW,OAAO;AAAA,UACxE,WAAW,MAAM,YAAY,SAAS,qBAAqB,WAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,YAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/Plugin.ts
21
- var Plugin_exports = {};
22
- __export(Plugin_exports, {
23
- PentairScreenlogicPlugin: () => PentairScreenlogicPlugin
24
- });
25
- module.exports = __toCommonJS(Plugin_exports);
26
- var import_payload_model = require("@xyo-network/payload-model");
27
- var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
28
- var import_pentair_payload_plugin2 = require("@xyo-network/pentair-payload-plugin");
29
-
30
- // src/Witness.ts
31
- var import_assert = require("@xylabs/assert");
32
- var import_abstract_witness = require("@xyo-network/abstract-witness");
33
- var import_pentair_payload_plugin = require("@xyo-network/pentair-payload-plugin");
34
- var import_node_screenlogic = require("node-screenlogic");
35
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
36
- var PentairScreenlogicWitness = class extends import_abstract_witness.AbstractWitness {
37
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
38
- async observeHandler(_payloads) {
39
- const finder = new import_node_screenlogic.FindUnits();
40
- const localUnit = (0, import_assert.assertEx)((await finder.searchAsync()).shift(), "No local screenlogic unit found");
41
- import_node_screenlogic.screenlogic.initUnit(localUnit);
42
- (0, import_assert.assertEx)(await import_node_screenlogic.screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
43
- return [
44
- {
45
- chem: await import_node_screenlogic.screenlogic.chem.getChemicalDataAsync(),
46
- chlor: await import_node_screenlogic.screenlogic.chlor.getIntellichlorConfigAsync(),
47
- equipment: {
48
- circuitNames: await import_node_screenlogic.screenlogic.equipment.getAllCircuitNamesAsync(),
49
- config: await import_node_screenlogic.screenlogic.equipment.getEquipmentConfigurationAsync(),
50
- controllerConfig: await import_node_screenlogic.screenlogic.equipment.getControllerConfigAsync(),
51
- customNames: await import_node_screenlogic.screenlogic.equipment.getCustomNamesAsync(),
52
- state: await import_node_screenlogic.screenlogic.equipment.getEquipmentStateAsync(),
53
- systemTime: await import_node_screenlogic.screenlogic.equipment.getSystemTimeAsync(),
54
- weatherForecast: await import_node_screenlogic.screenlogic.equipment.getWeatherForecastAsync()
55
- },
56
- schedule: {
57
- once: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RUNONCE),
58
- recurring: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RECURRING)
59
- },
60
- schema: import_pentair_payload_plugin.PentairScreenlogicSchema,
61
- version: await import_node_screenlogic.screenlogic.getVersionAsync()
62
- }
63
- ];
64
- }
65
- };
66
-
67
- // src/Plugin.ts
68
- var PentairScreenlogicPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
69
- { required: { [import_pentair_payload_plugin2.PentairScreenlogicSchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
70
- {
71
- witness: async (params) => {
72
- const result = await PentairScreenlogicWitness.create(params);
73
- return result;
74
- }
75
- }
76
- );
77
- // Annotate the CommonJS export names for ESM import in node:
78
- 0 && (module.exports = {
79
- PentairScreenlogicPlugin
80
- });
81
- //# sourceMappingURL=Plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\nimport { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\n\nimport { PentairScreenlogicWitness } from './Witness'\n\nexport const PentairScreenlogicPlugin = () =>\n createPayloadSetWitnessPlugin<PentairScreenlogicWitness>(\n { required: { [PentairScreenlogicSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await PentairScreenlogicWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAiC;AACjC,+BAA8C;AAC9C,IAAAA,iCAAyC;;;ACFzC,oBAAyB;AACzB,8BAAgC;AAGhC,oCAAoE;AAEpE,8BAAmD;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,kCAAU;AAC7B,UAAM,gBAAY,yBAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,wCAAY,SAAS,SAAS;AAC9B,gCAAS,MAAM,oCAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,oCAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,oCAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,oCAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,oCAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,oCAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,oCAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,oCAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,oCAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,oCAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,OAAO;AAAA,UACxE,WAAW,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,oCAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;;;AD5CO,IAAM,2BAA2B,UACtC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,uDAAwB,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EACxE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,0BAA0B,OAAO,MAAM;AAC5D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_pentair_payload_plugin"]}
@@ -1,56 +0,0 @@
1
- // src/Plugin.ts
2
- import { PayloadSetSchema } from "@xyo-network/payload-model";
3
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
4
- import { PentairScreenlogicSchema as PentairScreenlogicSchema2 } from "@xyo-network/pentair-payload-plugin";
5
-
6
- // src/Witness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { AbstractWitness } from "@xyo-network/abstract-witness";
9
- import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
10
- import { FindUnits, SchedTypes, screenlogic } from "node-screenlogic";
11
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
12
- var PentairScreenlogicWitness = class extends AbstractWitness {
13
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
14
- async observeHandler(_payloads) {
15
- const finder = new FindUnits();
16
- const localUnit = assertEx((await finder.searchAsync()).shift(), "No local screenlogic unit found");
17
- screenlogic.initUnit(localUnit);
18
- assertEx(await screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
19
- return [
20
- {
21
- chem: await screenlogic.chem.getChemicalDataAsync(),
22
- chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),
23
- equipment: {
24
- circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),
25
- config: await screenlogic.equipment.getEquipmentConfigurationAsync(),
26
- controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),
27
- customNames: await screenlogic.equipment.getCustomNamesAsync(),
28
- state: await screenlogic.equipment.getEquipmentStateAsync(),
29
- systemTime: await screenlogic.equipment.getSystemTimeAsync(),
30
- weatherForecast: await screenlogic.equipment.getWeatherForecastAsync()
31
- },
32
- schedule: {
33
- once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),
34
- recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING)
35
- },
36
- schema: PentairScreenlogicSchema,
37
- version: await screenlogic.getVersionAsync()
38
- }
39
- ];
40
- }
41
- };
42
-
43
- // src/Plugin.ts
44
- var PentairScreenlogicPlugin = () => createPayloadSetWitnessPlugin(
45
- { required: { [PentairScreenlogicSchema2]: 1 }, schema: PayloadSetSchema },
46
- {
47
- witness: async (params) => {
48
- const result = await PentairScreenlogicWitness.create(params);
49
- return result;
50
- }
51
- }
52
- );
53
- export {
54
- PentairScreenlogicPlugin
55
- };
56
- //# sourceMappingURL=Plugin.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\nimport { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\n\nimport { PentairScreenlogicWitness } from './Witness'\n\nexport const PentairScreenlogicPlugin = () =>\n createPayloadSetWitnessPlugin<PentairScreenlogicWitness>(\n { required: { [PentairScreenlogicSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await PentairScreenlogicWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";AAAA,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAC9C,SAAS,4BAAAA,iCAAgC;;;ACFzC,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAGhC,SAAoC,gCAAgC;AAEpE,SAAS,WAAW,YAAY,mBAAmB;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,UAAU;AAC7B,UAAM,YAAY,UAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,gBAAY,SAAS,SAAS;AAC9B,aAAS,MAAM,YAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,YAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,YAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,YAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,YAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,YAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,YAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,YAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,YAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,YAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,YAAY,SAAS,qBAAqB,WAAW,OAAO;AAAA,UACxE,WAAW,MAAM,YAAY,SAAS,qBAAqB,WAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,YAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;;;AD5CO,IAAM,2BAA2B,MACtC;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,yBAAwB,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACxE;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,0BAA0B,OAAO,MAAM;AAC5D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["PentairScreenlogicSchema","PentairScreenlogicSchema"]}
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/Witness.ts
21
- var Witness_exports = {};
22
- __export(Witness_exports, {
23
- PentairScreenlogicWitness: () => PentairScreenlogicWitness,
24
- PentairScreenlogicWitnessConfigSchema: () => PentairScreenlogicWitnessConfigSchema
25
- });
26
- module.exports = __toCommonJS(Witness_exports);
27
- var import_assert = require("@xylabs/assert");
28
- var import_abstract_witness = require("@xyo-network/abstract-witness");
29
- var import_pentair_payload_plugin = require("@xyo-network/pentair-payload-plugin");
30
- var import_node_screenlogic = require("node-screenlogic");
31
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
32
- var PentairScreenlogicWitness = class extends import_abstract_witness.AbstractWitness {
33
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
34
- async observeHandler(_payloads) {
35
- const finder = new import_node_screenlogic.FindUnits();
36
- const localUnit = (0, import_assert.assertEx)((await finder.searchAsync()).shift(), "No local screenlogic unit found");
37
- import_node_screenlogic.screenlogic.initUnit(localUnit);
38
- (0, import_assert.assertEx)(await import_node_screenlogic.screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
39
- return [
40
- {
41
- chem: await import_node_screenlogic.screenlogic.chem.getChemicalDataAsync(),
42
- chlor: await import_node_screenlogic.screenlogic.chlor.getIntellichlorConfigAsync(),
43
- equipment: {
44
- circuitNames: await import_node_screenlogic.screenlogic.equipment.getAllCircuitNamesAsync(),
45
- config: await import_node_screenlogic.screenlogic.equipment.getEquipmentConfigurationAsync(),
46
- controllerConfig: await import_node_screenlogic.screenlogic.equipment.getControllerConfigAsync(),
47
- customNames: await import_node_screenlogic.screenlogic.equipment.getCustomNamesAsync(),
48
- state: await import_node_screenlogic.screenlogic.equipment.getEquipmentStateAsync(),
49
- systemTime: await import_node_screenlogic.screenlogic.equipment.getSystemTimeAsync(),
50
- weatherForecast: await import_node_screenlogic.screenlogic.equipment.getWeatherForecastAsync()
51
- },
52
- schedule: {
53
- once: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RUNONCE),
54
- recurring: await import_node_screenlogic.screenlogic.schedule.getScheduleDataAsync(import_node_screenlogic.SchedTypes.RECURRING)
55
- },
56
- schema: import_pentair_payload_plugin.PentairScreenlogicSchema,
57
- version: await import_node_screenlogic.screenlogic.getVersionAsync()
58
- }
59
- ];
60
- }
61
- };
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- PentairScreenlogicWitness,
65
- PentairScreenlogicWitnessConfigSchema
66
- });
67
- //# sourceMappingURL=Witness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyB;AACzB,8BAAgC;AAGhC,oCAAoE;AAEpE,8BAAmD;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,kCAAU;AAC7B,UAAM,gBAAY,yBAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,wCAAY,SAAS,SAAS;AAC9B,gCAAS,MAAM,oCAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,oCAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,oCAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,oCAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,oCAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,oCAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,oCAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,oCAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,oCAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,oCAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,OAAO;AAAA,UACxE,WAAW,MAAM,oCAAY,SAAS,qBAAqB,mCAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,oCAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -1,41 +0,0 @@
1
- // src/Witness.ts
2
- import { assertEx } from "@xylabs/assert";
3
- import { AbstractWitness } from "@xyo-network/abstract-witness";
4
- import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
5
- import { FindUnits, SchedTypes, screenlogic } from "node-screenlogic";
6
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
7
- var PentairScreenlogicWitness = class extends AbstractWitness {
8
- static configSchemas = [PentairScreenlogicWitnessConfigSchema];
9
- async observeHandler(_payloads) {
10
- const finder = new FindUnits();
11
- const localUnit = assertEx((await finder.searchAsync()).shift(), "No local screenlogic unit found");
12
- screenlogic.initUnit(localUnit);
13
- assertEx(await screenlogic.connectAsync(), "Failed to connect to ScreenLogic");
14
- return [
15
- {
16
- chem: await screenlogic.chem.getChemicalDataAsync(),
17
- chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),
18
- equipment: {
19
- circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),
20
- config: await screenlogic.equipment.getEquipmentConfigurationAsync(),
21
- controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),
22
- customNames: await screenlogic.equipment.getCustomNamesAsync(),
23
- state: await screenlogic.equipment.getEquipmentStateAsync(),
24
- systemTime: await screenlogic.equipment.getSystemTimeAsync(),
25
- weatherForecast: await screenlogic.equipment.getWeatherForecastAsync()
26
- },
27
- schedule: {
28
- once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),
29
- recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING)
30
- },
31
- schema: PentairScreenlogicSchema,
32
- version: await screenlogic.getVersionAsync()
33
- }
34
- ];
35
- }
36
- };
37
- export {
38
- PentairScreenlogicWitness,
39
- PentairScreenlogicWitnessConfigSchema
40
- };
41
- //# sourceMappingURL=Witness.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport { FindUnits, SchedTypes, screenlogic } from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\nexport const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'\n\nexport type PentairScreenlogicWitnessConfig = WitnessConfig<{\n schema: PentairScreenlogicWitnessConfigSchema\n}>\n\nexport type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>\n\nexport class PentairScreenlogicWitness<\n TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [PentairScreenlogicWitnessConfigSchema]\n\n protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {\n const finder = new FindUnits()\n const localUnit = assertEx((await finder.searchAsync()).shift(), 'No local screenlogic unit found')\n screenlogic.initUnit(localUnit)\n assertEx(await screenlogic.connectAsync(), 'Failed to connect to ScreenLogic')\n\n return [\n {\n chem: await screenlogic.chem.getChemicalDataAsync(),\n chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),\n equipment: {\n circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),\n config: await screenlogic.equipment.getEquipmentConfigurationAsync(),\n controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),\n customNames: await screenlogic.equipment.getCustomNamesAsync(),\n state: await screenlogic.equipment.getEquipmentStateAsync(),\n systemTime: await screenlogic.equipment.getSystemTimeAsync(),\n weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),\n },\n schedule: {\n once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),\n recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),\n },\n schema: PentairScreenlogicSchema,\n version: await screenlogic.getVersionAsync(),\n },\n ] as PentairScreenlogicPayload[]\n }\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAGhC,SAAoC,gCAAgC;AAEpE,SAAS,WAAW,YAAY,mBAAmB;AAG5C,IAAM,wCAA+E;AAQrF,IAAM,4BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qCAAqC;AAAA,EAEtE,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,UAAU;AAC7B,UAAM,YAAY,UAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,iCAAiC;AAClG,gBAAY,SAAS,SAAS;AAC9B,aAAS,MAAM,YAAY,aAAa,GAAG,kCAAkC;AAE7E,WAAO;AAAA,MACL;AAAA,QACE,MAAM,MAAM,YAAY,KAAK,qBAAqB;AAAA,QAClD,OAAO,MAAM,YAAY,MAAM,2BAA2B;AAAA,QAC1D,WAAW;AAAA,UACT,cAAc,MAAM,YAAY,UAAU,wBAAwB;AAAA,UAClE,QAAQ,MAAM,YAAY,UAAU,+BAA+B;AAAA,UACnE,kBAAkB,MAAM,YAAY,UAAU,yBAAyB;AAAA,UACvE,aAAa,MAAM,YAAY,UAAU,oBAAoB;AAAA,UAC7D,OAAO,MAAM,YAAY,UAAU,uBAAuB;AAAA,UAC1D,YAAY,MAAM,YAAY,UAAU,mBAAmB;AAAA,UAC3D,iBAAiB,MAAM,YAAY,UAAU,wBAAwB;AAAA,QACvE;AAAA,QACA,UAAU;AAAA,UACR,MAAM,MAAM,YAAY,SAAS,qBAAqB,WAAW,OAAO;AAAA,UACxE,WAAW,MAAM,YAAY,SAAS,qBAAqB,WAAW,SAAS;AAAA,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,YAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;","names":[]}