@xyo-network/pentair-plugin 5.3.2 → 5.3.3

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.
@@ -0,0 +1,3 @@
1
+ import { PentairScreenlogicWitness } from './Witness.ts';
2
+ export declare const PentairScreenlogicPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<PentairScreenlogicWitness<import("./Witness.ts").PentairScreenlogicWitnessParams>>;
3
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AAExD,eAAO,MAAM,wBAAwB,2JASlC,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { AbstractWitness } from '@xyo-network/abstract-witness';
2
+ import type { AnyConfigSchema } from '@xyo-network/module-model';
3
+ import { type Payload, type Schema } from '@xyo-network/payload-model';
4
+ import type { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
5
+ export type PentairScreenlogicWitnessConfigSchema = typeof PentairScreenlogicWitnessConfigSchema;
6
+ export declare const PentairScreenlogicWitnessConfigSchema: "network.xyo.pentair.screenlogic.witness.config" & {
7
+ readonly __schema: true;
8
+ };
9
+ export type PentairScreenlogicWitnessConfig = WitnessConfig<{
10
+ schema: PentairScreenlogicWitnessConfigSchema;
11
+ }>;
12
+ export type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>;
13
+ export declare class PentairScreenlogicWitness<TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams> extends AbstractWitness<TParams> {
14
+ static readonly configSchemas: Schema[];
15
+ static readonly defaultConfigSchema: Schema;
16
+ protected observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]>;
17
+ }
18
+ //# sourceMappingURL=Witness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EACK,KAAK,OAAO,EAAE,KAAK,MAAM,EACpC,MAAM,4BAA4B,CAAA;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAK9E,MAAM,MAAM,qCAAqC,GAAG,OAAO,qCAAqC,CAAA;AAChG,eAAO,MAAM,qCAAqC;;CAAmE,CAAA;AAErH,MAAM,MAAM,+BAA+B,GAAG,aAAa,CAAC;IAC1D,MAAM,EAAE,qCAAqC,CAAA;CAC9C,CAAC,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,aAAa,CAAC,eAAe,CAAC,+BAA+B,CAAC,CAAC,CAAA;AAE7G,qBAAa,yBAAyB,CACpC,OAAO,SAAS,+BAA+B,GAAG,+BAA+B,CACjF,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAkE;IAClH,gBAAyB,mBAAmB,EAAE,MAAM,CAAwC;cAEnE,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4B5F"}
@@ -0,0 +1,3 @@
1
+ export { PentairScreenlogicPlugin as default, PentairScreenlogicPlugin } from './Plugin.ts';
2
+ export * from './Witness.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,IAAI,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC3F,cAAc,cAAc,CAAA"}
@@ -0,0 +1,67 @@
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/sdk-js";
8
+ import { AbstractWitness } from "@xyo-network/abstract-witness";
9
+ import {
10
+ asSchema
11
+ } from "@xyo-network/payload-model";
12
+ import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
13
+ import {
14
+ FindUnits,
15
+ SchedTypes,
16
+ screenlogic
17
+ } from "node-screenlogic";
18
+ var PentairScreenlogicWitnessConfigSchema = asSchema("network.xyo.pentair.screenlogic.witness.config", true);
19
+ var PentairScreenlogicWitness = class extends AbstractWitness {
20
+ static configSchemas = [...super.configSchemas, PentairScreenlogicWitnessConfigSchema];
21
+ static defaultConfigSchema = PentairScreenlogicWitnessConfigSchema;
22
+ async observeHandler(_payloads) {
23
+ const finder = new FindUnits();
24
+ const localUnit = assertEx((await finder.searchAsync()).shift(), () => "No local screenlogic unit found");
25
+ screenlogic.initUnit(localUnit);
26
+ assertEx(await screenlogic.connectAsync(), () => "Failed to connect to ScreenLogic");
27
+ return [
28
+ {
29
+ chem: await screenlogic.chem.getChemicalDataAsync(),
30
+ chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),
31
+ equipment: {
32
+ circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),
33
+ config: await screenlogic.equipment.getEquipmentConfigurationAsync(),
34
+ controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),
35
+ customNames: await screenlogic.equipment.getCustomNamesAsync(),
36
+ state: await screenlogic.equipment.getEquipmentStateAsync(),
37
+ systemTime: await screenlogic.equipment.getSystemTimeAsync(),
38
+ weatherForecast: await screenlogic.equipment.getWeatherForecastAsync()
39
+ },
40
+ schedule: {
41
+ once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),
42
+ recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING)
43
+ },
44
+ schema: PentairScreenlogicSchema,
45
+ version: await screenlogic.getVersionAsync()
46
+ }
47
+ ];
48
+ }
49
+ };
50
+
51
+ // src/Plugin.ts
52
+ var PentairScreenlogicPlugin = () => createPayloadSetWitnessPlugin(
53
+ { required: { [PentairScreenlogicSchema2]: 1 }, schema: PayloadSetSchema },
54
+ {
55
+ witness: async (params) => {
56
+ const result = await PentairScreenlogicWitness.create(params);
57
+ return result;
58
+ }
59
+ }
60
+ );
61
+ export {
62
+ PentairScreenlogicPlugin,
63
+ PentairScreenlogicWitness,
64
+ PentairScreenlogicWitnessConfigSchema,
65
+ PentairScreenlogicPlugin as default
66
+ };
67
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
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.ts'\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/sdk-js'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport {\n asSchema, type Payload, type Schema,\n} from '@xyo-network/payload-model'\nimport type { PentairScreenlogicPayload } from '@xyo-network/pentair-payload-plugin'\nimport { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport type { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'\nimport {\n FindUnits, SchedTypes, screenlogic,\n} from 'node-screenlogic'\n\nexport type PentairScreenlogicWitnessConfigSchema = typeof PentairScreenlogicWitnessConfigSchema\nexport const PentairScreenlogicWitnessConfigSchema = asSchema('network.xyo.pentair.screenlogic.witness.config', true)\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 readonly configSchemas: Schema[] = [...super.configSchemas, PentairScreenlogicWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = 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,wBA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AAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;;;ADlDO,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/pentair-plugin",
3
- "version": "5.3.2",
3
+ "version": "5.3.3",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,13 +30,14 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
- "!**/*.bench.*",
35
- "!**/*.spec.*",
36
- "!**/*.test.*"
33
+ "README.md"
37
34
  ],
35
+ "dependencies": {
36
+ "@xyo-network/pentair-payload-plugin": "workspace:^"
37
+ },
38
38
  "devDependencies": {
39
39
  "@xylabs/sdk-js": "^5.0.90",
40
+ "@xylabs/ts-scripts-common": "~7.5.10",
40
41
  "@xylabs/ts-scripts-yarn3": "~7.5.10",
41
42
  "@xylabs/tsconfig": "~7.5.10",
42
43
  "@xylabs/vitest-extended": "~5.0.90",
@@ -44,7 +45,6 @@
44
45
  "@xyo-network/module-model": "~5.3.5",
45
46
  "@xyo-network/payload-model": "~5.3.5",
46
47
  "@xyo-network/payloadset-plugin": "~5.3.5",
47
- "@xyo-network/pentair-payload-plugin": "5.3.2",
48
48
  "@xyo-network/sdk-js": "~5.3.5",
49
49
  "@xyo-network/witness-model": "~5.3.5",
50
50
  "node-screenlogic": "~2.1.1",
@@ -54,6 +54,12 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@xylabs/sdk-js": "^5",
57
+ "@xyo-network/abstract-witness": "^5",
58
+ "@xyo-network/module-model": "^5",
59
+ "@xyo-network/payload-model": "^5",
60
+ "@xyo-network/payloadset-plugin": "^5",
61
+ "@xyo-network/witness-model": "^5",
62
+ "node-screenlogic": "^2",
57
63
  "zod": "^4"
58
64
  },
59
65
  "publishConfig": {
package/src/Plugin.ts DELETED
@@ -1,16 +0,0 @@
1
- import { PayloadSetSchema } from '@xyo-network/payload-model'
2
- import { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'
3
- import { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'
4
-
5
- import { PentairScreenlogicWitness } from './Witness.ts'
6
-
7
- export const PentairScreenlogicPlugin = () =>
8
- createPayloadSetWitnessPlugin<PentairScreenlogicWitness>(
9
- { required: { [PentairScreenlogicSchema]: 1 }, schema: PayloadSetSchema },
10
- {
11
- witness: async (params) => {
12
- const result = await PentairScreenlogicWitness.create(params)
13
- return result
14
- },
15
- },
16
- )
package/src/Witness.ts DELETED
@@ -1,57 +0,0 @@
1
- import { assertEx } from '@xylabs/sdk-js'
2
- import { AbstractWitness } from '@xyo-network/abstract-witness'
3
- import type { AnyConfigSchema } from '@xyo-network/module-model'
4
- import {
5
- asSchema, type Payload, type Schema,
6
- } from '@xyo-network/payload-model'
7
- import type { PentairScreenlogicPayload } from '@xyo-network/pentair-payload-plugin'
8
- import { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'
9
- import type { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'
10
- import {
11
- FindUnits, SchedTypes, screenlogic,
12
- } from 'node-screenlogic'
13
-
14
- export type PentairScreenlogicWitnessConfigSchema = typeof PentairScreenlogicWitnessConfigSchema
15
- export const PentairScreenlogicWitnessConfigSchema = asSchema('network.xyo.pentair.screenlogic.witness.config', true)
16
-
17
- export type PentairScreenlogicWitnessConfig = WitnessConfig<{
18
- schema: PentairScreenlogicWitnessConfigSchema
19
- }>
20
-
21
- export type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>
22
-
23
- export class PentairScreenlogicWitness<
24
- TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams,
25
- > extends AbstractWitness<TParams> {
26
- static override readonly configSchemas: Schema[] = [...super.configSchemas, PentairScreenlogicWitnessConfigSchema]
27
- static override readonly defaultConfigSchema: Schema = PentairScreenlogicWitnessConfigSchema
28
-
29
- protected override async observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]> {
30
- const finder = new FindUnits()
31
- const localUnit = assertEx((await finder.searchAsync()).shift(), () => 'No local screenlogic unit found')
32
- screenlogic.initUnit(localUnit)
33
- assertEx(await screenlogic.connectAsync(), () => 'Failed to connect to ScreenLogic')
34
-
35
- return [
36
- {
37
- chem: await screenlogic.chem.getChemicalDataAsync(),
38
- chlor: await screenlogic.chlor.getIntellichlorConfigAsync(),
39
- equipment: {
40
- circuitNames: await screenlogic.equipment.getAllCircuitNamesAsync(),
41
- config: await screenlogic.equipment.getEquipmentConfigurationAsync(),
42
- controllerConfig: await screenlogic.equipment.getControllerConfigAsync(),
43
- customNames: await screenlogic.equipment.getCustomNamesAsync(),
44
- state: await screenlogic.equipment.getEquipmentStateAsync(),
45
- systemTime: await screenlogic.equipment.getSystemTimeAsync(),
46
- weatherForecast: await screenlogic.equipment.getWeatherForecastAsync(),
47
- },
48
- schedule: {
49
- once: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RUNONCE),
50
- recurring: await screenlogic.schedule.getScheduleDataAsync(SchedTypes.RECURRING),
51
- },
52
- schema: PentairScreenlogicSchema,
53
- version: await screenlogic.getVersionAsync(),
54
- },
55
- ] as PentairScreenlogicPayload[]
56
- }
57
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { PentairScreenlogicPlugin as default, PentairScreenlogicPlugin } from './Plugin.ts'
2
- export * from './Witness.ts'