@enyo-energy/energy-app-sdk 0.0.168 → 0.0.170

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.
@@ -97,6 +97,46 @@ export interface EnergyAppPackageOptionsDeviceDetectionMqtt {
97
97
  /** Matching values to identify the device */
98
98
  matchingValues: string[];
99
99
  }
100
+ /**
101
+ * Optional device detection configuration for UDP broadcast probing.
102
+ * The host broadcasts the probe message on the local network and matches a
103
+ * JSON field in each response against the expected values to identify the
104
+ * device.
105
+ *
106
+ * @example
107
+ * // Detect Marstek Venus batteries answering on port 30000:
108
+ * {
109
+ * port: 30000,
110
+ * message: { id: 0, method: 'Marstek.GetDevice', params: { ble_mac: '0' } },
111
+ * field: 'src',
112
+ * operation: 'startsWith',
113
+ * matchingValues: ['VenusC'],
114
+ * }
115
+ */
116
+ export interface EnergyAppPackageOptionsDeviceDetectionUdp {
117
+ /**
118
+ * Destination UDP port the device listens on. The probe is broadcast to
119
+ * this port (e.g. 30000 for Marstek Venus); responses are read from the
120
+ * datagrams the device sends back. Required — a UDP broadcast always needs
121
+ * a destination port.
122
+ */
123
+ port: number;
124
+ /**
125
+ * The probe message to broadcast. Provide a JSON-serializable object
126
+ * (sent as its JSON string) or a raw string payload.
127
+ */
128
+ message: Record<string, unknown> | string;
129
+ /**
130
+ * JSON field path in the response to match against. Supports dot notation
131
+ * for nested keys (e.g. `'src'` or `'result.device'`). If omitted, the
132
+ * entire response payload is matched.
133
+ */
134
+ field?: string;
135
+ /** The matching operation to perform on the response field value */
136
+ operation: 'eq' | 'startsWith';
137
+ /** Values to match the response field value against */
138
+ matchingValues: string[];
139
+ }
100
140
  /**
101
141
  * Optional device detection configuration
102
142
  */
@@ -108,6 +148,7 @@ export interface EnergyAppPackageOptionsDeviceDetection {
108
148
  eebus?: EnergyAppPackageOptionsDeviceDetectionEebus[];
109
149
  mqtt?: EnergyAppPackageOptionsDeviceDetectionMqtt[];
110
150
  mdns?: EnergyAppPackageOptionsDeviceDetectionMdns[];
151
+ udp?: EnergyAppPackageOptionsDeviceDetectionUdp[];
111
152
  }
112
153
  /**
113
154
  * Optional configuration settings for an Energy App package.
@@ -12,6 +12,27 @@ export interface ModbusOptions {
12
12
  unitId?: number;
13
13
  /** Whether to use TLS/SSL for the Modbus connection. Defaults to false (plain Modbus TCP). Set to true to enable Modbus Security (TLS, typically port 802). */
14
14
  useTls?: boolean;
15
+ /**
16
+ * PEM-encoded client certificate (or Buffer) presented for mutual-TLS Modbus Security
17
+ * connections. Only used when {@link useTls} is true.
18
+ */
19
+ cert?: string | Buffer;
20
+ /**
21
+ * PEM-encoded private key (or Buffer) matching {@link cert} for mutual-TLS connections.
22
+ * Only used when {@link useTls} is true.
23
+ */
24
+ key?: string | Buffer;
25
+ /**
26
+ * Trusted CA certificate(s) — a PEM string/Buffer, or an array of them — used to verify the
27
+ * server's certificate. Only used when {@link useTls} is true.
28
+ */
29
+ ca?: string | Buffer | Array<string | Buffer>;
30
+ /**
31
+ * Whether to reject a TLS connection whose server certificate cannot be verified against
32
+ * {@link ca}. When omitted, the transport's default verification behaviour is used. Only
33
+ * used when {@link useTls} is true.
34
+ */
35
+ rejectUnauthorized?: boolean;
15
36
  }
16
37
  /**
17
38
  * Interface for Modbus TCP/IP communication in enyo packages.
@@ -18,9 +18,11 @@ export interface EnergyAppSettings {
18
18
  * This will remove the setting regardless of whether it's for an appliance or the package.
19
19
  *
20
20
  * @param settingName - The unique name of the setting to remove
21
+ * @param applianceId - Optional appliance ID. If provided, only the setting scoped to that
22
+ * specific appliance is removed. If omitted, the setting is removed regardless of scope.
21
23
  * @returns Promise that resolves when the setting is successfully removed
22
24
  */
23
- removeSettingConfig(settingName: string): Promise<void>;
25
+ removeSettingConfig(settingName: string, applianceId?: string): Promise<void>;
24
26
  /**
25
27
  * Updates the value of an existing setting.
26
28
  * The setting is identified by its unique name across all appliances and package settings.
@@ -9,4 +9,5 @@ var EnyoNetworkDeviceDetectedAtEnum;
9
9
  EnyoNetworkDeviceDetectedAtEnum["Modbus"] = "modbus";
10
10
  EnyoNetworkDeviceDetectedAtEnum["Http"] = "http";
11
11
  EnyoNetworkDeviceDetectedAtEnum["Mdns"] = "mdns";
12
+ EnyoNetworkDeviceDetectedAtEnum["Udp"] = "udp";
12
13
  })(EnyoNetworkDeviceDetectedAtEnum || (exports.EnyoNetworkDeviceDetectedAtEnum = EnyoNetworkDeviceDetectedAtEnum = {}));
@@ -4,7 +4,8 @@ export declare enum EnyoNetworkDeviceDetectedAtEnum {
4
4
  Hostname = "hostname",
5
5
  Modbus = "modbus",
6
6
  Http = "http",
7
- Mdns = "mdns"
7
+ Mdns = "mdns",
8
+ Udp = "udp"
8
9
  }
9
10
  /**
10
11
  * Represents a detected network device with its connectivity information.
@@ -9,7 +9,7 @@ exports.getSdkVersion = getSdkVersion;
9
9
  /**
10
10
  * Current version of the enyo Energy App SDK.
11
11
  */
12
- exports.SDK_VERSION = '0.0.168';
12
+ exports.SDK_VERSION = '0.0.170';
13
13
  /**
14
14
  * Gets the current SDK version.
15
15
  * @returns The semantic version string of the SDK
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.168";
8
+ export declare const SDK_VERSION = "0.0.170";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
@@ -97,6 +97,46 @@ export interface EnergyAppPackageOptionsDeviceDetectionMqtt {
97
97
  /** Matching values to identify the device */
98
98
  matchingValues: string[];
99
99
  }
100
+ /**
101
+ * Optional device detection configuration for UDP broadcast probing.
102
+ * The host broadcasts the probe message on the local network and matches a
103
+ * JSON field in each response against the expected values to identify the
104
+ * device.
105
+ *
106
+ * @example
107
+ * // Detect Marstek Venus batteries answering on port 30000:
108
+ * {
109
+ * port: 30000,
110
+ * message: { id: 0, method: 'Marstek.GetDevice', params: { ble_mac: '0' } },
111
+ * field: 'src',
112
+ * operation: 'startsWith',
113
+ * matchingValues: ['VenusC'],
114
+ * }
115
+ */
116
+ export interface EnergyAppPackageOptionsDeviceDetectionUdp {
117
+ /**
118
+ * Destination UDP port the device listens on. The probe is broadcast to
119
+ * this port (e.g. 30000 for Marstek Venus); responses are read from the
120
+ * datagrams the device sends back. Required — a UDP broadcast always needs
121
+ * a destination port.
122
+ */
123
+ port: number;
124
+ /**
125
+ * The probe message to broadcast. Provide a JSON-serializable object
126
+ * (sent as its JSON string) or a raw string payload.
127
+ */
128
+ message: Record<string, unknown> | string;
129
+ /**
130
+ * JSON field path in the response to match against. Supports dot notation
131
+ * for nested keys (e.g. `'src'` or `'result.device'`). If omitted, the
132
+ * entire response payload is matched.
133
+ */
134
+ field?: string;
135
+ /** The matching operation to perform on the response field value */
136
+ operation: 'eq' | 'startsWith';
137
+ /** Values to match the response field value against */
138
+ matchingValues: string[];
139
+ }
100
140
  /**
101
141
  * Optional device detection configuration
102
142
  */
@@ -108,6 +148,7 @@ export interface EnergyAppPackageOptionsDeviceDetection {
108
148
  eebus?: EnergyAppPackageOptionsDeviceDetectionEebus[];
109
149
  mqtt?: EnergyAppPackageOptionsDeviceDetectionMqtt[];
110
150
  mdns?: EnergyAppPackageOptionsDeviceDetectionMdns[];
151
+ udp?: EnergyAppPackageOptionsDeviceDetectionUdp[];
111
152
  }
112
153
  /**
113
154
  * Optional configuration settings for an Energy App package.
@@ -12,6 +12,27 @@ export interface ModbusOptions {
12
12
  unitId?: number;
13
13
  /** Whether to use TLS/SSL for the Modbus connection. Defaults to false (plain Modbus TCP). Set to true to enable Modbus Security (TLS, typically port 802). */
14
14
  useTls?: boolean;
15
+ /**
16
+ * PEM-encoded client certificate (or Buffer) presented for mutual-TLS Modbus Security
17
+ * connections. Only used when {@link useTls} is true.
18
+ */
19
+ cert?: string | Buffer;
20
+ /**
21
+ * PEM-encoded private key (or Buffer) matching {@link cert} for mutual-TLS connections.
22
+ * Only used when {@link useTls} is true.
23
+ */
24
+ key?: string | Buffer;
25
+ /**
26
+ * Trusted CA certificate(s) — a PEM string/Buffer, or an array of them — used to verify the
27
+ * server's certificate. Only used when {@link useTls} is true.
28
+ */
29
+ ca?: string | Buffer | Array<string | Buffer>;
30
+ /**
31
+ * Whether to reject a TLS connection whose server certificate cannot be verified against
32
+ * {@link ca}. When omitted, the transport's default verification behaviour is used. Only
33
+ * used when {@link useTls} is true.
34
+ */
35
+ rejectUnauthorized?: boolean;
15
36
  }
16
37
  /**
17
38
  * Interface for Modbus TCP/IP communication in enyo packages.
@@ -18,9 +18,11 @@ export interface EnergyAppSettings {
18
18
  * This will remove the setting regardless of whether it's for an appliance or the package.
19
19
  *
20
20
  * @param settingName - The unique name of the setting to remove
21
+ * @param applianceId - Optional appliance ID. If provided, only the setting scoped to that
22
+ * specific appliance is removed. If omitted, the setting is removed regardless of scope.
21
23
  * @returns Promise that resolves when the setting is successfully removed
22
24
  */
23
- removeSettingConfig(settingName: string): Promise<void>;
25
+ removeSettingConfig(settingName: string, applianceId?: string): Promise<void>;
24
26
  /**
25
27
  * Updates the value of an existing setting.
26
28
  * The setting is identified by its unique name across all appliances and package settings.
@@ -4,7 +4,8 @@ export declare enum EnyoNetworkDeviceDetectedAtEnum {
4
4
  Hostname = "hostname",
5
5
  Modbus = "modbus",
6
6
  Http = "http",
7
- Mdns = "mdns"
7
+ Mdns = "mdns",
8
+ Udp = "udp"
8
9
  }
9
10
  /**
10
11
  * Represents a detected network device with its connectivity information.
@@ -6,4 +6,5 @@ export var EnyoNetworkDeviceDetectedAtEnum;
6
6
  EnyoNetworkDeviceDetectedAtEnum["Modbus"] = "modbus";
7
7
  EnyoNetworkDeviceDetectedAtEnum["Http"] = "http";
8
8
  EnyoNetworkDeviceDetectedAtEnum["Mdns"] = "mdns";
9
+ EnyoNetworkDeviceDetectedAtEnum["Udp"] = "udp";
9
10
  })(EnyoNetworkDeviceDetectedAtEnum || (EnyoNetworkDeviceDetectedAtEnum = {}));
package/dist/version.d.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export declare const SDK_VERSION = "0.0.168";
8
+ export declare const SDK_VERSION = "0.0.170";
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/dist/version.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Current version of the enyo Energy App SDK.
7
7
  */
8
- export const SDK_VERSION = '0.0.168';
8
+ export const SDK_VERSION = '0.0.170';
9
9
  /**
10
10
  * Gets the current SDK version.
11
11
  * @returns The semantic version string of the SDK
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enyo-energy/energy-app-sdk",
3
- "version": "0.0.168",
3
+ "version": "0.0.170",
4
4
  "description": "enyo Energy App SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",