@enyo-energy/energy-app-sdk 0.0.41 → 0.0.43
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/cjs/implementations/appliances/identifier-strategies.cjs +23 -1
- package/dist/cjs/implementations/appliances/identifier-strategies.d.cts +17 -0
- package/dist/cjs/packages/energy-app-secret-manager.d.cts +1 -1
- package/dist/cjs/types/enyo-data-bus-value.cjs +13 -1
- package/dist/cjs/types/enyo-data-bus-value.d.cts +14 -0
- package/dist/cjs/types/enyo-energy-tariff.d.cts +1 -7
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/implementations/appliances/identifier-strategies.d.ts +17 -0
- package/dist/implementations/appliances/identifier-strategies.js +21 -0
- package/dist/packages/energy-app-secret-manager.d.ts +1 -1
- package/dist/types/enyo-data-bus-value.d.ts +14 -0
- package/dist/types/enyo-data-bus-value.js +12 -0
- package/dist/types/enyo-energy-tariff.d.ts +1 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IdentifierStrategyFactory = exports.FallbackIdentifierStrategy = exports.CompositeIdentifierStrategy = exports.CustomMetadataStrategy = exports.SerialNumberStrategy = void 0;
|
|
3
|
+
exports.IdentifierStrategyFactory = exports.FallbackIdentifierStrategy = exports.CompositeIdentifierStrategy = exports.CustomMetadataStrategy = exports.TypeStrategy = exports.SerialNumberStrategy = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Strategy that uses the appliance's serial number as the identifier.
|
|
6
6
|
* Useful when appliances can move between network devices.
|
|
@@ -17,6 +17,22 @@ class SerialNumberStrategy {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
exports.SerialNumberStrategy = SerialNumberStrategy;
|
|
20
|
+
/**
|
|
21
|
+
* Strategy that uses the appliance's serial number as the identifier.
|
|
22
|
+
* Useful when appliances can move between network devices.
|
|
23
|
+
*/
|
|
24
|
+
class TypeStrategy {
|
|
25
|
+
name = 'type';
|
|
26
|
+
/**
|
|
27
|
+
* Extracts the serial number from the appliance metadata.
|
|
28
|
+
* @param appliance The appliance to extract the serial number from
|
|
29
|
+
* @returns The serial number or undefined
|
|
30
|
+
*/
|
|
31
|
+
extract(appliance) {
|
|
32
|
+
return appliance.type;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.TypeStrategy = TypeStrategy;
|
|
20
36
|
/**
|
|
21
37
|
* Strategy that uses a custom metadata field as the identifier.
|
|
22
38
|
* Allows using any field from the appliance metadata.
|
|
@@ -120,6 +136,12 @@ class IdentifierStrategyFactory {
|
|
|
120
136
|
static serialNumber() {
|
|
121
137
|
return new SerialNumberStrategy();
|
|
122
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Creates a serial number strategy.
|
|
141
|
+
*/
|
|
142
|
+
static type() {
|
|
143
|
+
return new TypeStrategy();
|
|
144
|
+
}
|
|
123
145
|
/**
|
|
124
146
|
* Creates a custom metadata field strategy.
|
|
125
147
|
* @param fieldName The metadata field to use
|
|
@@ -29,6 +29,19 @@ export declare class SerialNumberStrategy implements IdentifierStrategy {
|
|
|
29
29
|
*/
|
|
30
30
|
extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Strategy that uses the appliance's serial number as the identifier.
|
|
34
|
+
* Useful when appliances can move between network devices.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TypeStrategy implements IdentifierStrategy {
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Extracts the serial number from the appliance metadata.
|
|
40
|
+
* @param appliance The appliance to extract the serial number from
|
|
41
|
+
* @returns The serial number or undefined
|
|
42
|
+
*/
|
|
43
|
+
extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
|
|
44
|
+
}
|
|
32
45
|
/**
|
|
33
46
|
* Strategy that uses a custom metadata field as the identifier.
|
|
34
47
|
* Allows using any field from the appliance metadata.
|
|
@@ -96,6 +109,10 @@ export declare class IdentifierStrategyFactory {
|
|
|
96
109
|
* Creates a serial number strategy.
|
|
97
110
|
*/
|
|
98
111
|
static serialNumber(): SerialNumberStrategy;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a serial number strategy.
|
|
114
|
+
*/
|
|
115
|
+
static type(): SerialNumberStrategy;
|
|
99
116
|
/**
|
|
100
117
|
* Creates a custom metadata field strategy.
|
|
101
118
|
* @param fieldName The metadata field to use
|
|
@@ -17,7 +17,7 @@ export interface EnergyAppSecretManager {
|
|
|
17
17
|
* // Returns: { client_id: "...", client_secret: "..." }
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
getSecret(secretName: string, encryptionKey: string): Promise<
|
|
20
|
+
getSecret<T>(secretName: string, encryptionKey: string): Promise<T>;
|
|
21
21
|
/**
|
|
22
22
|
* Retrieves and decrypts multiple secrets from the developer organization's secret store in a single request.
|
|
23
23
|
* This is more efficient than making multiple individual requests.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnyoDataBusMessageEnum = exports.EnyoChargingStopReason = exports.EnyoChargingMeterValueContext = exports.EnyoInverterStateEnum = exports.EnyoBatteryStateEnum = void 0;
|
|
3
|
+
exports.EnyoDataBusMessageEnum = exports.EnyoChargingStopReason = exports.EnyoChargingMeterValueContext = exports.EnyoStringStateEnum = exports.EnyoInverterStateEnum = exports.EnyoBatteryStateEnum = void 0;
|
|
4
4
|
var EnyoBatteryStateEnum;
|
|
5
5
|
(function (EnyoBatteryStateEnum) {
|
|
6
6
|
EnyoBatteryStateEnum["Off"] = "off";
|
|
@@ -22,6 +22,18 @@ var EnyoInverterStateEnum;
|
|
|
22
22
|
EnyoInverterStateEnum["Fault"] = "fault";
|
|
23
23
|
EnyoInverterStateEnum["Standby"] = "standby";
|
|
24
24
|
})(EnyoInverterStateEnum || (exports.EnyoInverterStateEnum = EnyoInverterStateEnum = {}));
|
|
25
|
+
var EnyoStringStateEnum;
|
|
26
|
+
(function (EnyoStringStateEnum) {
|
|
27
|
+
EnyoStringStateEnum["Off"] = "off";
|
|
28
|
+
EnyoStringStateEnum["Sleeping"] = "sleeping";
|
|
29
|
+
EnyoStringStateEnum["Starting"] = "starting";
|
|
30
|
+
EnyoStringStateEnum["Mppt"] = "mppt";
|
|
31
|
+
EnyoStringStateEnum["Throttled"] = "throttled";
|
|
32
|
+
EnyoStringStateEnum["ShuttingDown"] = "shutting-down";
|
|
33
|
+
EnyoStringStateEnum["Fault"] = "fault";
|
|
34
|
+
EnyoStringStateEnum["Standby"] = "standby";
|
|
35
|
+
EnyoStringStateEnum["Test"] = " Test";
|
|
36
|
+
})(EnyoStringStateEnum || (exports.EnyoStringStateEnum = EnyoStringStateEnum = {}));
|
|
25
37
|
/**
|
|
26
38
|
* Charging meter value context defining when the measurement was taken
|
|
27
39
|
*/
|
|
@@ -20,6 +20,17 @@ export declare enum EnyoInverterStateEnum {
|
|
|
20
20
|
Fault = "fault",
|
|
21
21
|
Standby = "standby"
|
|
22
22
|
}
|
|
23
|
+
export declare enum EnyoStringStateEnum {
|
|
24
|
+
Off = "off",
|
|
25
|
+
Sleeping = "sleeping",
|
|
26
|
+
Starting = "starting",
|
|
27
|
+
Mppt = "mppt",
|
|
28
|
+
Throttled = "throttled",
|
|
29
|
+
ShuttingDown = "shutting-down",
|
|
30
|
+
Fault = "fault",
|
|
31
|
+
Standby = "standby",
|
|
32
|
+
Test = " Test"
|
|
33
|
+
}
|
|
23
34
|
/**
|
|
24
35
|
* Charging meter value context defining when the measurement was taken
|
|
25
36
|
*/
|
|
@@ -198,8 +209,11 @@ export interface EnyoDataBusBatteryValuesUpdateV1 extends EnyoDataBusMessage {
|
|
|
198
209
|
}
|
|
199
210
|
export interface EnyoDataBusInverterValuesV1String {
|
|
200
211
|
index: number;
|
|
212
|
+
name?: string;
|
|
201
213
|
voltage?: number;
|
|
202
214
|
powerW?: number;
|
|
215
|
+
current?: number;
|
|
216
|
+
state?: EnyoStringStateEnum;
|
|
203
217
|
}
|
|
204
218
|
export interface EnyoDataBusInverterValuesV1 extends EnyoDataBusMessage {
|
|
205
219
|
type: 'message';
|
|
@@ -22,9 +22,7 @@ export interface EnergyTariffConstantPricing {
|
|
|
22
22
|
/** Optional fixed price per kWh for grid feed-in */
|
|
23
23
|
feedInPricePerKwh?: number;
|
|
24
24
|
/** Start of validity period in ISO format */
|
|
25
|
-
validFromIso
|
|
26
|
-
/** End of validity period in ISO format (optional for indefinite validity) */
|
|
27
|
-
validUntilIso?: string;
|
|
25
|
+
validFromIso?: string;
|
|
28
26
|
}
|
|
29
27
|
/**
|
|
30
28
|
* Represents interval-based pricing structure (15min or 1hr intervals)
|
|
@@ -34,10 +32,6 @@ export interface EnergyTariffIntervalPricing {
|
|
|
34
32
|
interval: EnergyTariffInterval;
|
|
35
33
|
/** Array of price points for the specified intervals */
|
|
36
34
|
pricePoints: EnergyTariffPricePoint[];
|
|
37
|
-
/** Start date for which these intervals are valid in ISO format */
|
|
38
|
-
validFromIso: string;
|
|
39
|
-
/** End date for which these intervals are valid in ISO format */
|
|
40
|
-
validUntilIso: string;
|
|
41
35
|
}
|
|
42
36
|
/**
|
|
43
37
|
* Union type for different pricing data structures
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -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.
|
|
12
|
+
exports.SDK_VERSION = '0.0.43';
|
|
13
13
|
/**
|
|
14
14
|
* Gets the current SDK version.
|
|
15
15
|
* @returns The semantic version string of the SDK
|
package/dist/cjs/version.d.cts
CHANGED
|
@@ -29,6 +29,19 @@ export declare class SerialNumberStrategy implements IdentifierStrategy {
|
|
|
29
29
|
*/
|
|
30
30
|
extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Strategy that uses the appliance's serial number as the identifier.
|
|
34
|
+
* Useful when appliances can move between network devices.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TypeStrategy implements IdentifierStrategy {
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Extracts the serial number from the appliance metadata.
|
|
40
|
+
* @param appliance The appliance to extract the serial number from
|
|
41
|
+
* @returns The serial number or undefined
|
|
42
|
+
*/
|
|
43
|
+
extract(appliance: EnyoAppliance | ApplianceConfig): string | undefined;
|
|
44
|
+
}
|
|
32
45
|
/**
|
|
33
46
|
* Strategy that uses a custom metadata field as the identifier.
|
|
34
47
|
* Allows using any field from the appliance metadata.
|
|
@@ -96,6 +109,10 @@ export declare class IdentifierStrategyFactory {
|
|
|
96
109
|
* Creates a serial number strategy.
|
|
97
110
|
*/
|
|
98
111
|
static serialNumber(): SerialNumberStrategy;
|
|
112
|
+
/**
|
|
113
|
+
* Creates a serial number strategy.
|
|
114
|
+
*/
|
|
115
|
+
static type(): SerialNumberStrategy;
|
|
99
116
|
/**
|
|
100
117
|
* Creates a custom metadata field strategy.
|
|
101
118
|
* @param fieldName The metadata field to use
|
|
@@ -13,6 +13,21 @@ export class SerialNumberStrategy {
|
|
|
13
13
|
return appliance.metadata?.serialNumber;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Strategy that uses the appliance's serial number as the identifier.
|
|
18
|
+
* Useful when appliances can move between network devices.
|
|
19
|
+
*/
|
|
20
|
+
export class TypeStrategy {
|
|
21
|
+
name = 'type';
|
|
22
|
+
/**
|
|
23
|
+
* Extracts the serial number from the appliance metadata.
|
|
24
|
+
* @param appliance The appliance to extract the serial number from
|
|
25
|
+
* @returns The serial number or undefined
|
|
26
|
+
*/
|
|
27
|
+
extract(appliance) {
|
|
28
|
+
return appliance.type;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
16
31
|
/**
|
|
17
32
|
* Strategy that uses a custom metadata field as the identifier.
|
|
18
33
|
* Allows using any field from the appliance metadata.
|
|
@@ -113,6 +128,12 @@ export class IdentifierStrategyFactory {
|
|
|
113
128
|
static serialNumber() {
|
|
114
129
|
return new SerialNumberStrategy();
|
|
115
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Creates a serial number strategy.
|
|
133
|
+
*/
|
|
134
|
+
static type() {
|
|
135
|
+
return new TypeStrategy();
|
|
136
|
+
}
|
|
116
137
|
/**
|
|
117
138
|
* Creates a custom metadata field strategy.
|
|
118
139
|
* @param fieldName The metadata field to use
|
|
@@ -17,7 +17,7 @@ export interface EnergyAppSecretManager {
|
|
|
17
17
|
* // Returns: { client_id: "...", client_secret: "..." }
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
getSecret(secretName: string, encryptionKey: string): Promise<
|
|
20
|
+
getSecret<T>(secretName: string, encryptionKey: string): Promise<T>;
|
|
21
21
|
/**
|
|
22
22
|
* Retrieves and decrypts multiple secrets from the developer organization's secret store in a single request.
|
|
23
23
|
* This is more efficient than making multiple individual requests.
|
|
@@ -20,6 +20,17 @@ export declare enum EnyoInverterStateEnum {
|
|
|
20
20
|
Fault = "fault",
|
|
21
21
|
Standby = "standby"
|
|
22
22
|
}
|
|
23
|
+
export declare enum EnyoStringStateEnum {
|
|
24
|
+
Off = "off",
|
|
25
|
+
Sleeping = "sleeping",
|
|
26
|
+
Starting = "starting",
|
|
27
|
+
Mppt = "mppt",
|
|
28
|
+
Throttled = "throttled",
|
|
29
|
+
ShuttingDown = "shutting-down",
|
|
30
|
+
Fault = "fault",
|
|
31
|
+
Standby = "standby",
|
|
32
|
+
Test = " Test"
|
|
33
|
+
}
|
|
23
34
|
/**
|
|
24
35
|
* Charging meter value context defining when the measurement was taken
|
|
25
36
|
*/
|
|
@@ -198,8 +209,11 @@ export interface EnyoDataBusBatteryValuesUpdateV1 extends EnyoDataBusMessage {
|
|
|
198
209
|
}
|
|
199
210
|
export interface EnyoDataBusInverterValuesV1String {
|
|
200
211
|
index: number;
|
|
212
|
+
name?: string;
|
|
201
213
|
voltage?: number;
|
|
202
214
|
powerW?: number;
|
|
215
|
+
current?: number;
|
|
216
|
+
state?: EnyoStringStateEnum;
|
|
203
217
|
}
|
|
204
218
|
export interface EnyoDataBusInverterValuesV1 extends EnyoDataBusMessage {
|
|
205
219
|
type: 'message';
|
|
@@ -19,6 +19,18 @@ export var EnyoInverterStateEnum;
|
|
|
19
19
|
EnyoInverterStateEnum["Fault"] = "fault";
|
|
20
20
|
EnyoInverterStateEnum["Standby"] = "standby";
|
|
21
21
|
})(EnyoInverterStateEnum || (EnyoInverterStateEnum = {}));
|
|
22
|
+
export var EnyoStringStateEnum;
|
|
23
|
+
(function (EnyoStringStateEnum) {
|
|
24
|
+
EnyoStringStateEnum["Off"] = "off";
|
|
25
|
+
EnyoStringStateEnum["Sleeping"] = "sleeping";
|
|
26
|
+
EnyoStringStateEnum["Starting"] = "starting";
|
|
27
|
+
EnyoStringStateEnum["Mppt"] = "mppt";
|
|
28
|
+
EnyoStringStateEnum["Throttled"] = "throttled";
|
|
29
|
+
EnyoStringStateEnum["ShuttingDown"] = "shutting-down";
|
|
30
|
+
EnyoStringStateEnum["Fault"] = "fault";
|
|
31
|
+
EnyoStringStateEnum["Standby"] = "standby";
|
|
32
|
+
EnyoStringStateEnum["Test"] = " Test";
|
|
33
|
+
})(EnyoStringStateEnum || (EnyoStringStateEnum = {}));
|
|
22
34
|
/**
|
|
23
35
|
* Charging meter value context defining when the measurement was taken
|
|
24
36
|
*/
|
|
@@ -22,9 +22,7 @@ export interface EnergyTariffConstantPricing {
|
|
|
22
22
|
/** Optional fixed price per kWh for grid feed-in */
|
|
23
23
|
feedInPricePerKwh?: number;
|
|
24
24
|
/** Start of validity period in ISO format */
|
|
25
|
-
validFromIso
|
|
26
|
-
/** End of validity period in ISO format (optional for indefinite validity) */
|
|
27
|
-
validUntilIso?: string;
|
|
25
|
+
validFromIso?: string;
|
|
28
26
|
}
|
|
29
27
|
/**
|
|
30
28
|
* Represents interval-based pricing structure (15min or 1hr intervals)
|
|
@@ -34,10 +32,6 @@ export interface EnergyTariffIntervalPricing {
|
|
|
34
32
|
interval: EnergyTariffInterval;
|
|
35
33
|
/** Array of price points for the specified intervals */
|
|
36
34
|
pricePoints: EnergyTariffPricePoint[];
|
|
37
|
-
/** Start date for which these intervals are valid in ISO format */
|
|
38
|
-
validFromIso: string;
|
|
39
|
-
/** End date for which these intervals are valid in ISO format */
|
|
40
|
-
validUntilIso: string;
|
|
41
35
|
}
|
|
42
36
|
/**
|
|
43
37
|
* Union type for different pricing data structures
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED