@xyo-network/pentair-plugin 2.42.0

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.
Files changed (52) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +81 -0
  3. package/dist/cjs/Plugin.d.ts +15 -0
  4. package/dist/cjs/Plugin.d.ts.map +1 -0
  5. package/dist/cjs/Plugin.js +16 -0
  6. package/dist/cjs/Plugin.js.map +1 -0
  7. package/dist/cjs/Witness.d.ts +24 -0
  8. package/dist/cjs/Witness.d.ts.map +1 -0
  9. package/dist/cjs/Witness.js +36 -0
  10. package/dist/cjs/Witness.js.map +1 -0
  11. package/dist/cjs/index.d.ts +5 -0
  12. package/dist/cjs/index.d.ts.map +1 -0
  13. package/dist/cjs/index.js +10 -0
  14. package/dist/cjs/index.js.map +1 -0
  15. package/dist/cjs/screenlogic/controller.d.ts +100 -0
  16. package/dist/cjs/screenlogic/controller.d.ts.map +1 -0
  17. package/dist/cjs/screenlogic/controller.js +326 -0
  18. package/dist/cjs/screenlogic/controller.js.map +1 -0
  19. package/dist/cjs/screenlogic/index.d.ts +2 -0
  20. package/dist/cjs/screenlogic/index.d.ts.map +1 -0
  21. package/dist/cjs/screenlogic/index.js +5 -0
  22. package/dist/cjs/screenlogic/index.js.map +1 -0
  23. package/dist/docs.json +4932 -0
  24. package/dist/esm/Plugin.d.ts +15 -0
  25. package/dist/esm/Plugin.d.ts.map +1 -0
  26. package/dist/esm/Plugin.js +11 -0
  27. package/dist/esm/Plugin.js.map +1 -0
  28. package/dist/esm/Witness.d.ts +24 -0
  29. package/dist/esm/Witness.d.ts.map +1 -0
  30. package/dist/esm/Witness.js +18 -0
  31. package/dist/esm/Witness.js.map +1 -0
  32. package/dist/esm/index.d.ts +5 -0
  33. package/dist/esm/index.d.ts.map +1 -0
  34. package/dist/esm/index.js +6 -0
  35. package/dist/esm/index.js.map +1 -0
  36. package/dist/esm/screenlogic/controller.d.ts +100 -0
  37. package/dist/esm/screenlogic/controller.d.ts.map +1 -0
  38. package/dist/esm/screenlogic/controller.js +332 -0
  39. package/dist/esm/screenlogic/controller.js.map +1 -0
  40. package/dist/esm/screenlogic/index.d.ts +2 -0
  41. package/dist/esm/screenlogic/index.d.ts.map +1 -0
  42. package/dist/esm/screenlogic/index.js +2 -0
  43. package/dist/esm/screenlogic/index.js.map +1 -0
  44. package/package.json +55 -0
  45. package/src/Plugin.spec.ts +21 -0
  46. package/src/Plugin.ts +17 -0
  47. package/src/Witness.spec.ts +13 -0
  48. package/src/Witness.ts +41 -0
  49. package/src/index.ts +8 -0
  50. package/src/screenlogic/controller.ts +377 -0
  51. package/src/screenlogic/index.ts +1 -0
  52. package/src/screenlogic/types/index.d.ts +135 -0
@@ -0,0 +1,15 @@
1
+ import { XyoModuleParams } from '@xyo-network/module';
2
+ import { PayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin';
3
+ export declare const XyoPentairScreenlogicPlugin: () => PayloadSetWitnessPlugin<XyoModuleParams<import("@xyo-network/payload").SchemaFields & import("@xyo-network/payload").PayloadFields & {
4
+ security?: {
5
+ allowed?: Record<string, string[][]> | undefined;
6
+ disallowed?: Record<string, string[]> | undefined;
7
+ } | undefined;
8
+ } & {
9
+ schema: "network.xyo.pentair.screenlogic.witness.config";
10
+ } & {
11
+ targetSet?: (import("@xyo-network/payload").SchemaFields & import("@xyo-network/payload").PayloadFields & import("@xyo-network/payload").PayloadSet & {
12
+ schema: "network.xyo.payload.set";
13
+ }) | undefined;
14
+ }>>;
15
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAA0B,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAKhG,eAAO,MAAM,2BAA2B;;;;;;;;;;;GASrC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { PayloadSetSchema } from '@xyo-network/payload';
2
+ import { createPayloadSetPlugin } from '@xyo-network/payloadset-plugin';
3
+ import { XyoPentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin';
4
+ import { XyoPentairScreenlogicWitness } from './Witness';
5
+ export const XyoPentairScreenlogicPlugin = () => createPayloadSetPlugin({ required: { [XyoPentairScreenlogicSchema]: 1 }, schema: PayloadSetSchema }, {
6
+ witness: async (params) => {
7
+ const result = await XyoPentairScreenlogicWitness.create(params);
8
+ return result;
9
+ },
10
+ });
11
+ //# sourceMappingURL=Plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAA2B,MAAM,gCAAgC,CAAA;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AAEjF,OAAO,EAAE,4BAA4B,EAAsC,MAAM,WAAW,CAAA;AAE5F,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE,CAC9C,sBAAsB,CACpB,EAAE,QAAQ,EAAE,EAAE,CAAC,2BAA2B,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAC5E;IACE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,4BAA4B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAChE,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CACF,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { XyoModuleParams } from '@xyo-network/module';
2
+ import { XyoPayload } from '@xyo-network/payload';
3
+ import { AbstractWitness, XyoWitnessConfig } from '@xyo-network/witness';
4
+ import { Controller } from './screenlogic';
5
+ export type XyoPentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config';
6
+ export declare const XyoPentairScreenlogicWitnessConfigSchema: XyoPentairScreenlogicWitnessConfigSchema;
7
+ export interface PentairServer {
8
+ address: string;
9
+ gatewayName: string;
10
+ gatewaySubtype: number;
11
+ gatewayType: number;
12
+ port: number;
13
+ type: number;
14
+ }
15
+ export type XyoPentairScreenlogicWitnessConfig = XyoWitnessConfig<{
16
+ schema: XyoPentairScreenlogicWitnessConfigSchema;
17
+ }>;
18
+ export declare class XyoPentairScreenlogicWitness extends AbstractWitness<XyoPentairScreenlogicWitnessConfig> {
19
+ static configSchema: "network.xyo.pentair.screenlogic.witness.config";
20
+ protected controller: Controller;
21
+ static create(params?: XyoModuleParams<XyoPentairScreenlogicWitnessConfig>): Promise<XyoPentairScreenlogicWitness>;
22
+ observe(_payloads?: Partial<XyoPayload>[]): Promise<XyoPayload[]>;
23
+ }
24
+ //# sourceMappingURL=Witness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,MAAM,MAAM,wCAAwC,GAAG,gDAAgD,CAAA;AACvG,eAAO,MAAM,wCAAwC,EAAE,wCAA2F,CAAA;AAElJ,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IAEf,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IAEnB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,kCAAkC,GAAG,gBAAgB,CAAC;IAChE,MAAM,EAAE,wCAAwC,CAAA;CACjD,CAAC,CAAA;AAEF,qBAAa,4BAA6B,SAAQ,eAAe,CAAC,kCAAkC,CAAC;IACnG,OAAgB,YAAY,mDAA2C;IAGvE,SAAS,CAAC,UAAU,aAAmB;WAEjB,MAAM,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,kCAAkC,CAAC,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAIlH,OAAO,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;CAKjF"}
@@ -0,0 +1,18 @@
1
+ import { XyoPentairScreenlogicSchema } from '@xyo-network/pentair-payload-plugin';
2
+ import { AbstractWitness } from '@xyo-network/witness';
3
+ import { Controller } from './screenlogic';
4
+ export const XyoPentairScreenlogicWitnessConfigSchema = 'network.xyo.pentair.screenlogic.witness.config';
5
+ export class XyoPentairScreenlogicWitness extends AbstractWitness {
6
+ static configSchema = XyoPentairScreenlogicWitnessConfigSchema;
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
+ controller = new Controller();
9
+ static async create(params) {
10
+ return (await super.create(params));
11
+ }
12
+ async observe(_payloads) {
13
+ const config = await this.controller.getPoolConfig();
14
+ const status = await this.controller.getPoolStatus();
15
+ return await super.observe([{ config, schema: XyoPentairScreenlogicSchema, status }]);
16
+ }
17
+ }
18
+ //# sourceMappingURL=Witness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Witness.js","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,2BAA2B,EAAE,MAAM,qCAAqC,CAAA;AAC/G,OAAO,EAAE,eAAe,EAAoB,MAAM,sBAAsB,CAAA;AAExE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAG1C,MAAM,CAAC,MAAM,wCAAwC,GAA6C,gDAAgD,CAAA;AAiBlJ,MAAM,OAAO,4BAA6B,SAAQ,eAAmD;IACnG,MAAM,CAAU,YAAY,GAAG,wCAAwC,CAAA;IAEvE,8DAA8D;IACpD,UAAU,GAAG,IAAI,UAAU,EAAE,CAAA;IAEvC,MAAM,CAAU,KAAK,CAAC,MAAM,CAAC,MAA4D;QACvF,OAAO,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAiC,CAAA;IACrE,CAAC;IAEQ,KAAK,CAAC,OAAO,CAAC,SAAiC;QACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA;QACpD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA;QACpD,OAAO,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,EAAE,CAAmC,CAAC,CAAA;IACzH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { XyoPentairScreenlogicPlugin } from './Plugin';
2
+ export * from './Witness';
3
+ export { XyoPentairScreenlogicPlugin };
4
+ export default XyoPentairScreenlogicPlugin;
5
+ //# 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,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAEtD,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,2BAA2B,EAAE,CAAA;AAGtC,eAAe,2BAA2B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { XyoPentairScreenlogicPlugin } from './Plugin';
2
+ export * from './Witness';
3
+ export { XyoPentairScreenlogicPlugin };
4
+ // eslint-disable-next-line import/no-default-export
5
+ export default XyoPentairScreenlogicPlugin;
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAEtD,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,2BAA2B,EAAE,CAAA;AAEtC,oDAAoD;AACpD,eAAe,2BAA2B,CAAA"}
@@ -0,0 +1,100 @@
1
+ import ScreenLogic from 'node-screenlogic';
2
+ interface ControllerOptions {
3
+ ip_address?: string;
4
+ log?: typeof console;
5
+ password?: string;
6
+ port?: number;
7
+ username?: string;
8
+ }
9
+ export declare class Controller {
10
+ static readonly HEAT_MODE_HEAT_PUMP = 3;
11
+ static readonly HEAT_MODE_OFF = 0;
12
+ static readonly HEAT_MODE_SOLAR = 1;
13
+ static readonly HEAT_MODE_SOLAR_PREFERRED = 2;
14
+ static readonly HEAT_MODE_UNCHANGED = 4;
15
+ static readonly POOL_CIRCUIT_ID = 505;
16
+ static readonly SPA_CIRCUIT_ID = 500;
17
+ private readonly ip_address?;
18
+ private readonly log;
19
+ private readonly password?;
20
+ private readonly port?;
21
+ private readonly username?;
22
+ constructor(settings?: ControllerOptions);
23
+ _getConnection(): Promise<ScreenLogic.UnitConnection>;
24
+ /** get a connection by udp broadcast */
25
+ _getConnectionByBroadcast(): Promise<ScreenLogic.UnitConnection>;
26
+ /** get a connection by IP address */
27
+ _getConnectionByIPAddress(): Promise<ScreenLogic.UnitConnection>;
28
+ /** find a unit by remote login */
29
+ _getConnectionByRemoteLogin(): Promise<ScreenLogic.UnitConnection>;
30
+ _getPoolConfig(connection: ScreenLogic.UnitConnection): Promise<PoolConfig>;
31
+ _getPoolStatus(connection: ScreenLogic.UnitConnection): Promise<PoolStatus>;
32
+ _login(connection: ScreenLogic.UnitConnection): Promise<void>;
33
+ _sendLightCommand(connection: ScreenLogic.UnitConnection, cmd: number): Promise<void>;
34
+ _setCircuitState(connection: ScreenLogic.UnitConnection, circuitId: number, circuitState: boolean): Promise<void>;
35
+ _setHeatMode(connection: ScreenLogic.UnitConnection, bodyType: number, heatMode: number): Promise<void>;
36
+ _setHeatPoint(connection: ScreenLogic.UnitConnection, bodyType: number, heatPoint: number): Promise<void>;
37
+ getPoolConfig(): Promise<PoolConfig>;
38
+ getPoolStatus(): Promise<PoolStatus>;
39
+ sendLightCommand(cmd: number): Promise<void>;
40
+ setCircuitState(circuitId: number, circuitState: boolean): Promise<void>;
41
+ setHeatMode(bodyType: number, heatMode: number): Promise<void>;
42
+ setHeatPoint(bodyType: number, heatPoint: number): Promise<void>;
43
+ }
44
+ export declare class ControllerError extends Error {
45
+ }
46
+ export interface PoolCircuitJson {
47
+ id: number;
48
+ name: string;
49
+ }
50
+ export declare class PoolCircuit implements PoolCircuitJson {
51
+ readonly id: number;
52
+ readonly name: string;
53
+ constructor(id: number, name: string);
54
+ }
55
+ export interface PoolConfigJson {
56
+ circuits: PoolCircuitJson[];
57
+ deviceId: string;
58
+ gatewayName: string;
59
+ hasPool: boolean;
60
+ hasSpa: boolean;
61
+ isCelsius: boolean;
62
+ poolMaxSetPoint: number;
63
+ poolMinSetPoint: number;
64
+ softwareVersion: string;
65
+ spaMaxSetPoint: number;
66
+ spaMinSetPoint: number;
67
+ }
68
+ export declare class PoolConfig implements PoolConfigJson {
69
+ circuits: PoolCircuit[];
70
+ readonly deviceId: string;
71
+ readonly gatewayName: string;
72
+ readonly hasPool: boolean;
73
+ readonly hasSpa: boolean;
74
+ readonly isCelsius: boolean;
75
+ readonly poolMaxSetPoint: number;
76
+ readonly poolMinSetPoint: number;
77
+ readonly softwareVersion: string;
78
+ readonly spaMaxSetPoint: number;
79
+ readonly spaMinSetPoint: number;
80
+ constructor(gatewayName: string, softwareVersion: string, config: any);
81
+ }
82
+ export declare class PoolStatus {
83
+ readonly airTemperature: number;
84
+ readonly circuitState: Map<number, number>;
85
+ readonly hasPool: boolean;
86
+ readonly hasSpa: boolean;
87
+ readonly isPoolActive: boolean;
88
+ readonly isPoolHeating: boolean;
89
+ readonly isSpaActive: boolean;
90
+ readonly isSpaHeating: boolean;
91
+ readonly poolHeatMode: number;
92
+ readonly poolSetPoint: number;
93
+ readonly poolTemperature: number;
94
+ readonly spaHeatMode: number;
95
+ readonly spaSetPoint: number;
96
+ readonly spaTemperature: number;
97
+ constructor(status: any);
98
+ }
99
+ export {};
100
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/screenlogic/controller.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAI1C,UAAU,iBAAiB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,OAAO,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,mBAAmB,KAAI;IACvC,MAAM,CAAC,QAAQ,CAAC,aAAa,KAAI;IACjC,MAAM,CAAC,QAAQ,CAAC,eAAe,KAAI;IACnC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,KAAI;IAC7C,MAAM,CAAC,QAAQ,CAAC,mBAAmB,KAAI;IAEvC,MAAM,CAAC,QAAQ,CAAC,eAAe,OAAM;IACrC,MAAM,CAAC,QAAQ,CAAC,cAAc,OAAM;IAEpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IAEpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAQ;gBAEtB,QAAQ,CAAC,EAAE,iBAAiB;IAQxC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC;IAUrD,wCAAwC;IACxC,yBAAyB,IAAI,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC;IAiB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AAE,GAAG;CAuBtE;AAED,qBAAa,UAAU;IACrB,SAAgB,cAAc,EAAE,MAAM,CAAA;IACtC,SAAgB,YAAY,sBAA4B;IACxD,SAAgB,OAAO,EAAE,OAAO,CAAA;IAChC,SAAgB,MAAM,EAAE,OAAO,CAAA;IAC/B,SAAgB,YAAY,EAAE,OAAO,CAAA;IACrC,SAAgB,aAAa,EAAE,OAAO,CAAA;IACtC,SAAgB,WAAW,EAAE,OAAO,CAAA;IACpC,SAAgB,YAAY,EAAE,OAAO,CAAA;IACrC,SAAgB,YAAY,EAAE,MAAM,CAAA;IACpC,SAAgB,YAAY,EAAE,MAAM,CAAA;IACpC,SAAgB,eAAe,EAAE,MAAM,CAAA;IACvC,SAAgB,WAAW,EAAE,MAAM,CAAA;IACnC,SAAgB,WAAW,EAAE,MAAM,CAAA;IACnC,SAAgB,cAAc,EAAE,MAAM,CAAA;gBAG1B,MAAM,EAAE,GAAG;CAwBxB"}
@@ -0,0 +1,332 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import ScreenLogic from 'node-screenlogic';
3
+ export class Controller {
4
+ static HEAT_MODE_HEAT_PUMP = 3;
5
+ static HEAT_MODE_OFF = 0;
6
+ static HEAT_MODE_SOLAR = 1;
7
+ static HEAT_MODE_SOLAR_PREFERRED = 2;
8
+ static HEAT_MODE_UNCHANGED = 4;
9
+ static POOL_CIRCUIT_ID = 505;
10
+ static SPA_CIRCUIT_ID = 500;
11
+ ip_address;
12
+ log;
13
+ password;
14
+ port;
15
+ username;
16
+ constructor(settings) {
17
+ this.log = settings?.log ?? console;
18
+ this.ip_address = settings?.ip_address;
19
+ this.port = settings?.port;
20
+ this.username = settings?.username;
21
+ this.password = settings?.password;
22
+ }
23
+ _getConnection() {
24
+ if (this.ip_address) {
25
+ return this._getConnectionByIPAddress();
26
+ }
27
+ else if (this.username && this.password) {
28
+ return this._getConnectionByRemoteLogin();
29
+ }
30
+ else {
31
+ return this._getConnectionByBroadcast();
32
+ }
33
+ }
34
+ /** get a connection by udp broadcast */
35
+ _getConnectionByBroadcast() {
36
+ return new Promise((resolve, reject) => {
37
+ const finder = new ScreenLogic.FindUnits();
38
+ finder
39
+ .on('serverFound', (server) => {
40
+ finder.close();
41
+ const connection = new ScreenLogic.UnitConnection(server);
42
+ connection.gatewayName = server.gatewayName;
43
+ resolve(connection);
44
+ })
45
+ .on('error', (err) => {
46
+ reject(err);
47
+ });
48
+ finder.search();
49
+ });
50
+ }
51
+ /** get a connection by IP address */
52
+ _getConnectionByIPAddress() {
53
+ return new Promise((resolve, _reject) => {
54
+ const connection = new ScreenLogic.UnitConnection(this.port || 80, this.ip_address, this.password);
55
+ connection.gatewayName = this.username ?? 'Pentair: XX-XX-XX';
56
+ resolve(connection);
57
+ });
58
+ }
59
+ /** find a unit by remote login */
60
+ _getConnectionByRemoteLogin() {
61
+ return new Promise((resolve, reject) => {
62
+ const remote = new ScreenLogic.RemoteLogin(this.username);
63
+ remote
64
+ .on('gatewayFound', (unit) => {
65
+ remote.close();
66
+ if (unit && unit.gatewayFound) {
67
+ const connection = new ScreenLogic.UnitConnection(unit.port, unit.ipAddr, this.password);
68
+ connection.gatewayName = this.username;
69
+ resolve(connection);
70
+ }
71
+ else {
72
+ reject(new ControllerError('no remote unit found'));
73
+ }
74
+ })
75
+ .on('error', (err) => {
76
+ reject(err);
77
+ });
78
+ remote.connect();
79
+ });
80
+ }
81
+ _getPoolConfig(connection) {
82
+ let softwareVersion = '';
83
+ return new Promise((resolve, reject) => {
84
+ connection
85
+ .once('version', (version) => {
86
+ softwareVersion = version.version;
87
+ connection.getControllerConfig();
88
+ })
89
+ .once('controllerConfig', (poolConfig) => {
90
+ //this.log.debug('controllerConfig', poolConfig)
91
+ resolve(new PoolConfig(connection.gatewayName, softwareVersion, poolConfig));
92
+ })
93
+ .on('error', (err) => {
94
+ reject(err);
95
+ });
96
+ connection.getVersion();
97
+ });
98
+ }
99
+ _getPoolStatus(connection) {
100
+ return new Promise((resolve, reject) => {
101
+ connection
102
+ .once('poolStatus', (status) => {
103
+ //this.log.debug('poolStatus', status)
104
+ resolve(new PoolStatus(status));
105
+ })
106
+ .on('error', (err) => {
107
+ reject(err);
108
+ });
109
+ connection.getPoolStatus();
110
+ });
111
+ }
112
+ _login(connection) {
113
+ return new Promise((resolve, reject) => {
114
+ connection
115
+ .once('loggedIn', () => {
116
+ resolve();
117
+ })
118
+ .once('loginFailed', () => {
119
+ reject(new ControllerError('unable to login'));
120
+ })
121
+ .on('error', (err) => {
122
+ reject(err);
123
+ });
124
+ connection.connect();
125
+ });
126
+ }
127
+ _sendLightCommand(connection, cmd) {
128
+ return new Promise((resolve, reject) => {
129
+ connection
130
+ .once('sentLightCommand', () => {
131
+ resolve();
132
+ })
133
+ .once('badParameter', () => {
134
+ reject(new ControllerError('bad parameter passed to send light command'));
135
+ })
136
+ .on('error', (err) => {
137
+ reject(err);
138
+ });
139
+ connection.sendLightCommand(0, cmd);
140
+ });
141
+ }
142
+ _setCircuitState(connection, circuitId, circuitState) {
143
+ return new Promise((resolve, reject) => {
144
+ connection
145
+ .once('circuitStateChanged', () => {
146
+ resolve();
147
+ })
148
+ .once('badParameter', () => {
149
+ reject(new ControllerError('bad parameter passed to set command'));
150
+ })
151
+ .on('error', (err) => {
152
+ reject(err);
153
+ });
154
+ connection.setCircuitState(0, circuitId, circuitState ? 1 : 0);
155
+ });
156
+ }
157
+ _setHeatMode(connection, bodyType, heatMode) {
158
+ return new Promise((resolve, reject) => {
159
+ connection
160
+ .once('heatModeChanged', () => {
161
+ resolve();
162
+ })
163
+ .once('badParameter', () => {
164
+ reject(new ControllerError('bad parameter passed to set command'));
165
+ })
166
+ .on('error', (err) => {
167
+ reject(err);
168
+ });
169
+ connection.setHeatMode(0, bodyType, heatMode);
170
+ });
171
+ }
172
+ _setHeatPoint(connection, bodyType, heatPoint) {
173
+ return new Promise((resolve, reject) => {
174
+ connection
175
+ .once('setPointChanged', () => {
176
+ resolve();
177
+ })
178
+ .once('badParameter', () => {
179
+ reject(new ControllerError('bad parameter passed to set command'));
180
+ })
181
+ .on('error', (err) => {
182
+ reject(err);
183
+ });
184
+ connection.setSetPoint(0, bodyType, heatPoint);
185
+ });
186
+ }
187
+ async getPoolConfig() {
188
+ const connection = await this._getConnection();
189
+ try {
190
+ await this._login(connection);
191
+ return await this._getPoolConfig(connection);
192
+ }
193
+ finally {
194
+ connection.close();
195
+ }
196
+ }
197
+ async getPoolStatus() {
198
+ const connection = await this._getConnection();
199
+ try {
200
+ await this._login(connection);
201
+ return await this._getPoolStatus(connection);
202
+ }
203
+ finally {
204
+ connection.close();
205
+ }
206
+ }
207
+ async sendLightCommand(cmd) {
208
+ const connection = await this._getConnection();
209
+ try {
210
+ await this._login(connection);
211
+ return await this._sendLightCommand(connection, cmd);
212
+ }
213
+ finally {
214
+ connection.close();
215
+ }
216
+ }
217
+ async setCircuitState(circuitId, circuitState) {
218
+ const connection = await this._getConnection();
219
+ try {
220
+ await this._login(connection);
221
+ return await this._setCircuitState(connection, circuitId, circuitState);
222
+ }
223
+ finally {
224
+ connection.close();
225
+ }
226
+ }
227
+ async setHeatMode(bodyType, heatMode) {
228
+ const connection = await this._getConnection();
229
+ try {
230
+ await this._login(connection);
231
+ return await this._setHeatMode(connection, bodyType, heatMode);
232
+ }
233
+ finally {
234
+ connection.close();
235
+ }
236
+ }
237
+ async setHeatPoint(bodyType, heatPoint) {
238
+ const connection = await this._getConnection();
239
+ try {
240
+ await this._login(connection);
241
+ return await this._setHeatPoint(connection, bodyType, heatPoint);
242
+ }
243
+ finally {
244
+ connection.close();
245
+ }
246
+ }
247
+ }
248
+ export class ControllerError extends Error {
249
+ }
250
+ export class PoolCircuit {
251
+ id;
252
+ name;
253
+ constructor(id, name) {
254
+ this.id = id;
255
+ this.name = name;
256
+ }
257
+ }
258
+ export class PoolConfig {
259
+ circuits = [];
260
+ deviceId;
261
+ gatewayName;
262
+ hasPool;
263
+ hasSpa;
264
+ isCelsius;
265
+ poolMaxSetPoint;
266
+ poolMinSetPoint;
267
+ softwareVersion;
268
+ spaMaxSetPoint;
269
+ spaMinSetPoint;
270
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
271
+ constructor(gatewayName, softwareVersion, config) {
272
+ this.gatewayName = gatewayName;
273
+ this.deviceId = gatewayName.replace('Pentair: ', '');
274
+ this.softwareVersion = softwareVersion;
275
+ this.isCelsius = config.degC;
276
+ this.poolMinSetPoint = config.minSetPoint[0] ?? 0;
277
+ this.poolMaxSetPoint = config.maxSetPoint[0] ?? 0;
278
+ this.spaMinSetPoint = config.minSetPoint[1] ?? 0;
279
+ this.spaMaxSetPoint = config.maxSetPoint[1] ?? 0;
280
+ this.hasSpa = false;
281
+ this.hasPool = false;
282
+ this.circuits = [];
283
+ for (const circuit of config.bodyArray) {
284
+ const poolCircuit = new PoolCircuit(circuit.circuitId, circuit.name);
285
+ this.circuits.push(poolCircuit);
286
+ if (poolCircuit.id === Controller.POOL_CIRCUIT_ID) {
287
+ this.hasPool = true;
288
+ }
289
+ else if (poolCircuit.id === Controller.SPA_CIRCUIT_ID) {
290
+ this.hasSpa = true;
291
+ }
292
+ }
293
+ }
294
+ }
295
+ export class PoolStatus {
296
+ airTemperature;
297
+ circuitState = new Map();
298
+ hasPool;
299
+ hasSpa;
300
+ isPoolActive;
301
+ isPoolHeating;
302
+ isSpaActive;
303
+ isSpaHeating;
304
+ poolHeatMode;
305
+ poolSetPoint;
306
+ poolTemperature;
307
+ spaHeatMode;
308
+ spaSetPoint;
309
+ spaTemperature;
310
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
311
+ constructor(status) {
312
+ // save circuit state
313
+ this.circuitState = new Map();
314
+ for (const circuit of status.circuitArray) {
315
+ this.circuitState.set(circuit.id, circuit.state);
316
+ }
317
+ this.hasPool = this.circuitState.get(Controller.POOL_CIRCUIT_ID) !== undefined;
318
+ this.hasSpa = this.circuitState.get(Controller.SPA_CIRCUIT_ID) !== undefined;
319
+ this.poolTemperature = status.currentTemp[0];
320
+ this.poolSetPoint = status.setPoint[0];
321
+ this.isPoolActive = this.hasPool && status.isPoolActive();
322
+ this.isPoolHeating = this.hasPool && status.heatStatus[0] !== 0;
323
+ this.poolHeatMode = status.heatMode[0];
324
+ this.spaTemperature = status.currentTemp[1];
325
+ this.spaSetPoint = status.setPoint[1];
326
+ this.isSpaActive = this.hasSpa && status.isSpaActive();
327
+ this.isSpaHeating = this.hasSpa && status.heatStatus[1] !== 0;
328
+ this.spaHeatMode = status.heatMode[1];
329
+ this.airTemperature = status.airTemp;
330
+ }
331
+ }
332
+ //# sourceMappingURL=controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../src/screenlogic/controller.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAY1C,MAAM,OAAO,UAAU;IACrB,MAAM,CAAU,mBAAmB,GAAG,CAAC,CAAA;IACvC,MAAM,CAAU,aAAa,GAAG,CAAC,CAAA;IACjC,MAAM,CAAU,eAAe,GAAG,CAAC,CAAA;IACnC,MAAM,CAAU,yBAAyB,GAAG,CAAC,CAAA;IAC7C,MAAM,CAAU,mBAAmB,GAAG,CAAC,CAAA;IAEvC,MAAM,CAAU,eAAe,GAAG,GAAG,CAAA;IACrC,MAAM,CAAU,cAAc,GAAG,GAAG,CAAA;IAEnB,UAAU,CAAS;IACnB,GAAG,CAAgB;IAEnB,QAAQ,CAAS;IACjB,IAAI,CAAS;IACb,QAAQ,CAAS;IAElC,YAAY,QAA4B;QACtC,IAAI,CAAC,GAAG,GAAG,QAAQ,EAAE,GAAG,IAAI,OAAO,CAAA;QACnC,IAAI,CAAC,UAAU,GAAG,QAAQ,EAAE,UAAU,CAAA;QACtC,IAAI,CAAC,IAAI,GAAG,QAAQ,EAAE,IAAI,CAAA;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,EAAE,QAAQ,CAAA;QAClC,IAAI,CAAC,QAAQ,GAAG,QAAQ,EAAE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CAAC,KAAK,CAAC,CAAA;QAC7D,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;QAErC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,OAAO,CAAA;IACtC,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from './controller';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screenlogic/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './controller';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/screenlogic/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@xyo-network/pentair-plugin",
3
+ "author": {
4
+ "email": "support@xyo.network",
5
+ "name": "XYO Development Team",
6
+ "url": "https://xyo.network"
7
+ },
8
+ "bugs": {
9
+ "email": "support@xyo.network",
10
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
+ },
12
+ "dependencies": {
13
+ "@xyo-network/module": "^2.42.0",
14
+ "@xyo-network/payload": "^2.42.0",
15
+ "@xyo-network/payloadset-plugin": "^2.42.0",
16
+ "@xyo-network/pentair-payload-plugin": "^2.42.0",
17
+ "@xyo-network/witness": "^2.42.0",
18
+ "node-screenlogic": "^1.10.1",
19
+ "tslib": "^2.4.1"
20
+ },
21
+ "description": "Primary SDK for using XYO Protocol 2.0",
22
+ "browser": "dist/esm/index.js",
23
+ "docs": "dist/docs.json",
24
+ "exports": {
25
+ ".": {
26
+ "node": {
27
+ "import": "./dist/esm/index.js",
28
+ "require": "./dist/cjs/index.js"
29
+ },
30
+ "browser": {
31
+ "import": "./dist/esm/index.js",
32
+ "require": "./dist/cjs/index.js"
33
+ },
34
+ "default": "./dist/esm/index.js"
35
+ },
36
+ "./dist/docs.json": {
37
+ "default": "./dist/docs.json"
38
+ },
39
+ "./package.json": "./package.json"
40
+ },
41
+ "main": "dist/cjs/index.js",
42
+ "module": "dist/esm/index.js",
43
+ "homepage": "https://xyo.network",
44
+ "license": "LGPL-3.0-only",
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
51
+ },
52
+ "sideEffects": false,
53
+ "types": "dist/esm/index.d.ts",
54
+ "version": "2.42.0"
55
+ }