@xyo-network/pentair-plugin 5.2.3 → 5.3.1

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.
@@ -1,9 +1,11 @@
1
1
  import { AbstractWitness } from '@xyo-network/abstract-witness';
2
2
  import type { AnyConfigSchema } from '@xyo-network/module-model';
3
- import type { Payload, Schema } from '@xyo-network/payload-model';
3
+ import { type Payload, type Schema } from '@xyo-network/payload-model';
4
4
  import type { WitnessConfig, WitnessParams } from '@xyo-network/witness-model';
5
- export type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config';
6
- export declare const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema;
5
+ export type PentairScreenlogicWitnessConfigSchema = typeof PentairScreenlogicWitnessConfigSchema;
6
+ export declare const PentairScreenlogicWitnessConfigSchema: "network.xyo.pentair.screenlogic.witness.config" & {
7
+ readonly __schema: true;
8
+ };
7
9
  export type PentairScreenlogicWitnessConfig = WitnessConfig<{
8
10
  schema: PentairScreenlogicWitnessConfigSchema;
9
11
  }>;
@@ -1 +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,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAK9E,MAAM,MAAM,qCAAqC,GAAG,gDAAgD,CAAA;AACpG,eAAO,MAAM,qCAAqC,EAAE,qCAAwF,CAAA;AAE5I,MAAM,MAAM,+BAA+B,GAAG,aAAa,CAAC;IAC1D,MAAM,EAAE,qCAAqC,CAAA;CAC9C,CAAC,CAAA;AAEF,MAAM,MAAM,+BAA+B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OAAO,EAAE,CAAC;CA4B5F"}
@@ -6,13 +6,16 @@ import { PentairScreenlogicSchema as PentairScreenlogicSchema2 } from "@xyo-netw
6
6
  // src/Witness.ts
7
7
  import { assertEx } from "@xylabs/assert";
8
8
  import { AbstractWitness } from "@xyo-network/abstract-witness";
9
+ import {
10
+ asSchema
11
+ } from "@xyo-network/payload-model";
9
12
  import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
10
13
  import {
11
14
  FindUnits,
12
15
  SchedTypes,
13
16
  screenlogic
14
17
  } from "node-screenlogic";
15
- var PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
18
+ var PentairScreenlogicWitnessConfigSchema = asSchema("network.xyo.pentair.screenlogic.witness.config", true);
16
19
  var PentairScreenlogicWitness = class extends AbstractWitness {
17
20
  static configSchemas = [...super.configSchemas, PentairScreenlogicWitnessConfigSchema];
18
21
  static defaultConfigSchema = PentairScreenlogicWitnessConfigSchema;
@@ -1 +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/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Payload, Schema } 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 = '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 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: Pent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,QACjF;AAAA,QACA,QAAQ;AAAA,QACR,SAAS,MAAM,YAAY,gBAAgB;AAAA,MAC7C;AAAA,IACF;AAAA,EACF;AACF;;;ADhDO,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
+ {"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/assert'\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,wBAAwB;AACjC,SAAS,qCAAqC;AAC9C,SAAS,4BAAAA,iCAAgC;;;ACFzC,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,OACK;AAEP,SAAS,gCAAgC;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,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.2.3",
3
+ "version": "5.3.1",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -36,24 +36,24 @@
36
36
  "!**/*.test.*"
37
37
  ],
38
38
  "dependencies": {
39
- "@xylabs/assert": "~5.0.49",
40
- "@xyo-network/abstract-witness": "~5.2.14",
41
- "@xyo-network/module-model": "~5.2.14",
42
- "@xyo-network/payload-model": "~5.2.14",
43
- "@xyo-network/payloadset-plugin": "~5.2.14",
44
- "@xyo-network/pentair-payload-plugin": "~5.2.3",
45
- "@xyo-network/witness-model": "~5.2.14",
39
+ "@xylabs/assert": "~5.0.64",
40
+ "@xyo-network/abstract-witness": "~5.3.2",
41
+ "@xyo-network/module-model": "~5.3.2",
42
+ "@xyo-network/payload-model": "~5.3.2",
43
+ "@xyo-network/payloadset-plugin": "~5.3.2",
44
+ "@xyo-network/pentair-payload-plugin": "5.3.1",
45
+ "@xyo-network/witness-model": "~5.3.2",
46
46
  "node-screenlogic": "~2.1.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@xylabs/ts-scripts-yarn3": "~7.2.8",
50
- "@xylabs/tsconfig": "~7.2.8",
51
- "@xylabs/vitest-extended": "~5.0.49",
52
- "@xyo-network/payload-wrapper": "~5.2.14",
49
+ "@xylabs/ts-scripts-yarn3": "~7.3.2",
50
+ "@xylabs/tsconfig": "~7.3.2",
51
+ "@xylabs/vitest-extended": "~5.0.64",
52
+ "@xyo-network/payload-wrapper": "~5.3.2",
53
53
  "typescript": "~5.9.3",
54
- "vitest": "~4.0.15"
54
+ "vitest": "~4.0.18"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  }
59
- }
59
+ }
package/src/Witness.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import { AbstractWitness } from '@xyo-network/abstract-witness'
3
3
  import type { AnyConfigSchema } from '@xyo-network/module-model'
4
- import type { Payload, Schema } from '@xyo-network/payload-model'
4
+ import {
5
+ asSchema, type Payload, type Schema,
6
+ } from '@xyo-network/payload-model'
5
7
  import type { PentairScreenlogicPayload } from '@xyo-network/pentair-payload-plugin'
6
8
  import { PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'
7
9
  import type { WitnessConfig, WitnessParams } from '@xyo-network/witness-model'
@@ -9,8 +11,8 @@ import {
9
11
  FindUnits, SchedTypes, screenlogic,
10
12
  } from 'node-screenlogic'
11
13
 
12
- export type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'
13
- export const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config'
14
+ export type PentairScreenlogicWitnessConfigSchema = typeof PentairScreenlogicWitnessConfigSchema
15
+ export const PentairScreenlogicWitnessConfigSchema = asSchema('network.xyo.pentair.screenlogic.witness.config', true)
14
16
 
15
17
  export type PentairScreenlogicWitnessConfig = WitnessConfig<{
16
18
  schema: PentairScreenlogicWitnessConfigSchema