@xyo-network/pentair-plugin 2.75.0 → 2.75.2
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/browser/Plugin.d.cts +54 -0
- package/dist/browser/Plugin.d.cts.map +1 -0
- package/dist/browser/Plugin.js +3 -42
- package/dist/browser/Plugin.js.map +1 -1
- package/dist/browser/Witness.d.cts +14 -0
- package/dist/browser/Witness.d.cts.map +1 -0
- package/dist/browser/Witness.js +3 -4
- package/dist/browser/Witness.js.map +1 -1
- package/dist/browser/index.d.cts +5 -0
- package/dist/browser/index.d.cts.map +1 -0
- package/dist/browser/index.js +2 -56
- package/dist/browser/index.js.map +1 -1
- package/dist/docs.json +22336 -0
- package/dist/node/Plugin.d.cts +54 -0
- package/dist/node/Plugin.d.cts.map +1 -0
- package/dist/node/Plugin.js +44 -4
- package/dist/node/Plugin.js.map +1 -1
- package/dist/node/Plugin.mjs +42 -3
- package/dist/node/Plugin.mjs.map +1 -1
- package/dist/node/Witness.d.cts +14 -0
- package/dist/node/Witness.d.cts.map +1 -0
- package/dist/node/Witness.js +5 -3
- package/dist/node/Witness.js.map +1 -1
- package/dist/node/Witness.mjs +4 -3
- package/dist/node/Witness.mjs.map +1 -1
- package/dist/node/index.d.cts +5 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.js +63 -6
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +56 -2
- package/dist/node/index.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { PentairScreenlogicWitness } from './Witness';
|
|
2
|
+
export declare const PentairScreenlogicPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<PentairScreenlogicWitness<import("@xyo-network/core").BaseParamsFields & {
|
|
3
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
5
|
+
accountDerivationPath?: string | undefined;
|
|
6
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
7
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
|
+
readonly name?: string | undefined;
|
|
9
|
+
readonly paging?: Record<string, {
|
|
10
|
+
size?: number | undefined;
|
|
11
|
+
}> | undefined;
|
|
12
|
+
readonly security?: {
|
|
13
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
14
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
15
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly sign?: boolean | undefined;
|
|
18
|
+
readonly storeQueries?: boolean | undefined;
|
|
19
|
+
readonly timestamp?: boolean | undefined;
|
|
20
|
+
} & Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
21
|
+
accountDerivationPath?: string | undefined;
|
|
22
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
23
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
24
|
+
readonly name?: string | undefined;
|
|
25
|
+
readonly paging?: Record<string, {
|
|
26
|
+
size?: number | undefined;
|
|
27
|
+
}> | undefined;
|
|
28
|
+
readonly security?: {
|
|
29
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
30
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
31
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
readonly sign?: boolean | undefined;
|
|
34
|
+
readonly storeQueries?: boolean | undefined;
|
|
35
|
+
readonly timestamp?: boolean | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
archivist?: string | undefined;
|
|
38
|
+
schema: "network.xyo.pentair.screenlogic.witness.config";
|
|
39
|
+
targetSet?: (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/payload-model").PayloadSet & {
|
|
40
|
+
schema: "network.xyo.payload.set";
|
|
41
|
+
}) | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
schema: "network.xyo.pentair.screenlogic.witness.config";
|
|
44
|
+
}, "schema"> & {
|
|
45
|
+
schema: "network.xyo.pentair.screenlogic.witness.config";
|
|
46
|
+
}, "schema"> & {
|
|
47
|
+
schema: string;
|
|
48
|
+
}, "schema"> & {
|
|
49
|
+
schema: string;
|
|
50
|
+
};
|
|
51
|
+
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
52
|
+
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
53
|
+
}>>;
|
|
54
|
+
//# 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,WAAW,CAAA;AAErD,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASlC,CAAA"}
|
package/dist/browser/Plugin.js
CHANGED
|
@@ -1,48 +1,9 @@
|
|
|
1
|
-
// src/Plugin.ts
|
|
2
1
|
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
3
2
|
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
3
|
import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
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 },
|
|
4
|
+
import { PentairScreenlogicWitness } from "./Witness";
|
|
5
|
+
const PentairScreenlogicPlugin = () => createPayloadSetWitnessPlugin(
|
|
6
|
+
{ required: { [PentairScreenlogicSchema]: 1 }, schema: PayloadSetSchema },
|
|
46
7
|
{
|
|
47
8
|
witness: async (params) => {
|
|
48
9
|
const result = await PentairScreenlogicWitness.create(params);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts"
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.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"],"mappings":"AAAA,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAC9C,SAAS,gCAAgC;AAEzC,SAAS,iCAAiC;AAEnC,MAAM,2BAA2B,MACtC;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,wBAAwB,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":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnyConfigSchema } from '@xyo-network/module';
|
|
2
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import { AbstractWitness, WitnessConfig, WitnessParams } from '@xyo-network/witness';
|
|
4
|
+
export type PentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config';
|
|
5
|
+
export declare const PentairScreenlogicWitnessConfigSchema: PentairScreenlogicWitnessConfigSchema;
|
|
6
|
+
export type PentairScreenlogicWitnessConfig = WitnessConfig<{
|
|
7
|
+
schema: PentairScreenlogicWitnessConfigSchema;
|
|
8
|
+
}>;
|
|
9
|
+
export type PentairScreenlogicWitnessParams = WitnessParams<AnyConfigSchema<PentairScreenlogicWitnessConfig>>;
|
|
10
|
+
export declare class PentairScreenlogicWitness<TParams extends PentairScreenlogicWitnessParams = PentairScreenlogicWitnessParams> extends AbstractWitness<TParams> {
|
|
11
|
+
static configSchemas: "network.xyo.pentair.screenlogic.witness.config"[];
|
|
12
|
+
protected observeHandler(_payloads?: Partial<Payload>[]): Promise<Payload[]>;
|
|
13
|
+
}
|
|
14
|
+
//# 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,qBAAqB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpF,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,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,OAAgB,aAAa,qDAA0C;cAE9C,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA4B5F"}
|
package/dist/browser/Witness.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
// src/Witness.ts
|
|
2
1
|
import { assertEx } from "@xylabs/assert";
|
|
3
2
|
import { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
|
|
4
3
|
import { AbstractWitness } from "@xyo-network/witness";
|
|
5
4
|
import { FindUnits, SchedTypes, screenlogic } from "node-screenlogic";
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const PentairScreenlogicWitnessConfigSchema = "network.xyo.pentair.screenlogic.witness.config";
|
|
6
|
+
class PentairScreenlogicWitness extends AbstractWitness {
|
|
8
7
|
static configSchemas = [PentairScreenlogicWitnessConfigSchema];
|
|
9
8
|
async observeHandler(_payloads) {
|
|
10
9
|
const finder = new FindUnits();
|
|
@@ -33,7 +32,7 @@ var PentairScreenlogicWitness = class extends AbstractWitness {
|
|
|
33
32
|
}
|
|
34
33
|
];
|
|
35
34
|
}
|
|
36
|
-
}
|
|
35
|
+
}
|
|
37
36
|
export {
|
|
38
37
|
PentairScreenlogicWitness,
|
|
39
38
|
PentairScreenlogicWitnessConfigSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AnyConfigSchema } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { AbstractWitness, WitnessConfig, WitnessParams } from '@xyo-network/witness'\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":"
|
|
1
|
+
{"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AnyConfigSchema } from '@xyo-network/module'\nimport { Payload } from '@xyo-network/payload-model'\nimport { PentairScreenlogicPayload, PentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin'\nimport { AbstractWitness, WitnessConfig, WitnessParams } from '@xyo-network/witness'\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;AAGzB,SAAoC,gCAAgC;AACpE,SAAS,uBAAqD;AAC9D,SAAS,WAAW,YAAY,mBAAmB;AAG5C,MAAM,wCAA+E;AAQrF,MAAM,kCAEH,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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;AAEnD,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,wBAAwB,EAAE,CAAA;AAGnC,eAAe,wBAAwB,CAAA"}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,62 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { PentairScreenlogicSchema } from "@xyo-network/pentair-payload-plugin";
|
|
9
|
-
import { AbstractWitness } from "@xyo-network/witness";
|
|
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
|
-
|
|
54
|
-
// src/index.ts
|
|
1
|
+
import { PentairScreenlogicPlugin } from "./Plugin";
|
|
2
|
+
export * from "./Witness";
|
|
55
3
|
var src_default = PentairScreenlogicPlugin;
|
|
56
4
|
export {
|
|
57
5
|
PentairScreenlogicPlugin,
|
|
58
|
-
PentairScreenlogicWitness,
|
|
59
|
-
PentairScreenlogicWitnessConfigSchema,
|
|
60
6
|
src_default as default
|
|
61
7
|
};
|
|
62
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import { PentairScreenlogicPlugin } from './Plugin'\n\nexport * from './Witness'\n\nexport { PentairScreenlogicPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default PentairScreenlogicPlugin\n"],"mappings":"AAAA,SAAS,gCAAgC;AAEzC,cAAc;AAKd,IAAO,cAAQ;","names":[]}
|