@xyo-network/pentair-plugin 5.3.1 → 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.
- package/dist/neutral/index.mjs +1 -1
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +27 -18
- package/src/Plugin.ts +0 -16
- package/src/Witness.ts +0 -57
- package/src/index.ts +0 -2
package/dist/neutral/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
|
4
4
|
import { PentairScreenlogicSchema as PentairScreenlogicSchema2 } from "@xyo-network/pentair-payload-plugin";
|
|
5
5
|
|
|
6
6
|
// src/Witness.ts
|
|
7
|
-
import { assertEx } from "@xylabs/
|
|
7
|
+
import { assertEx } from "@xylabs/sdk-js";
|
|
8
8
|
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
9
9
|
import {
|
|
10
10
|
asSchema
|
|
@@ -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/
|
|
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,wBAAwB;AACjC,SAAS,qCAAqC;AAC9C,SAAS,4BAAAA,iCAAgC;;;ACFzC,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAEhC;AAAA,EACE;AAAA,OACK;AAEP,SAAS,gCAAgC;AAEzC;AAAA,EACE;AAAA,EAAW;AAAA,EAAY;AAAA,OAClB;AAGA,IAAM,wCAAwC,SAAS,kDAAkD,IAAI;AAQ7G,IAAM,4BAAN,cAEG,gBAAyB;AAAA,EACjC,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,qCAAqC;AAAA,EACjH,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe,WAAoD;AAC1F,UAAM,SAAS,IAAI,UAAU;AAC7B,UAAM,YAAY,UAAU,MAAM,OAAO,YAAY,GAAG,MAAM,GAAG,MAAM,iCAAiC;AACxG,gBAAY,SAAS,SAAS;AAC9B,aAAS,MAAM,YAAY,aAAa,GAAG,MAAM,kCAAkC;AAEnF,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;;;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.
|
|
3
|
+
"version": "5.3.3",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -30,28 +30,37 @@
|
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
33
|
-
"
|
|
34
|
-
"!**/*.bench.*",
|
|
35
|
-
"!**/*.spec.*",
|
|
36
|
-
"!**/*.test.*"
|
|
33
|
+
"README.md"
|
|
37
34
|
],
|
|
38
35
|
"dependencies": {
|
|
39
|
-
"@
|
|
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
|
-
"node-screenlogic": "~2.1.1"
|
|
36
|
+
"@xyo-network/pentair-payload-plugin": "workspace:^"
|
|
47
37
|
},
|
|
48
38
|
"devDependencies": {
|
|
49
|
-
"@xylabs/
|
|
50
|
-
"@xylabs/
|
|
51
|
-
"@xylabs/
|
|
52
|
-
"@
|
|
39
|
+
"@xylabs/sdk-js": "^5.0.90",
|
|
40
|
+
"@xylabs/ts-scripts-common": "~7.5.10",
|
|
41
|
+
"@xylabs/ts-scripts-yarn3": "~7.5.10",
|
|
42
|
+
"@xylabs/tsconfig": "~7.5.10",
|
|
43
|
+
"@xylabs/vitest-extended": "~5.0.90",
|
|
44
|
+
"@xyo-network/abstract-witness": "~5.3.5",
|
|
45
|
+
"@xyo-network/module-model": "~5.3.5",
|
|
46
|
+
"@xyo-network/payload-model": "~5.3.5",
|
|
47
|
+
"@xyo-network/payloadset-plugin": "~5.3.5",
|
|
48
|
+
"@xyo-network/sdk-js": "~5.3.5",
|
|
49
|
+
"@xyo-network/witness-model": "~5.3.5",
|
|
50
|
+
"node-screenlogic": "~2.1.1",
|
|
53
51
|
"typescript": "~5.9.3",
|
|
54
|
-
"vitest": "~4.
|
|
52
|
+
"vitest": "~4.1.2",
|
|
53
|
+
"zod": "^4.3.6"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
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",
|
|
63
|
+
"zod": "^4"
|
|
55
64
|
},
|
|
56
65
|
"publishConfig": {
|
|
57
66
|
"access": "public"
|
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/assert'
|
|
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