@enyo-energy/energy-app-sdk 0.0.118 → 0.0.119
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/packages/energy-app-mqtt.d.cts +21 -1
- package/dist/cjs/types/enyo-data-bus-value.cjs +2 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +3 -1
- package/dist/cjs/types/enyo-mqtt.d.cts +28 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/cjs/version.d.cts +1 -1
- package/dist/packages/energy-app-mqtt.d.ts +21 -1
- package/dist/types/enyo-data-bus-value.d.ts +3 -1
- package/dist/types/enyo-data-bus-value.js +2 -0
- package/dist/types/enyo-mqtt.d.ts +28 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage } from "../types/enyo-mqtt.cjs";
|
|
1
|
+
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage, EnyoMqttAvailableConnectionDetails } from "../types/enyo-mqtt.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* Interface for MQTT communication in enyo packages.
|
|
4
4
|
* Provides MQTT client functionality with support for both the SDK-provided
|
|
@@ -59,6 +59,26 @@ export interface EnergyAppMqtt {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
connect: (options: MqttExternalConnectOptions) => Promise<EnergyAppMqttClient>;
|
|
62
|
+
/**
|
|
63
|
+
* Get connection details for MQTT brokers exposed to the energy app.
|
|
64
|
+
* Currently returns details for the SDK-provided local MQTT broker so callers
|
|
65
|
+
* can connect with their own MQTT client implementation when {@link connectInternal}
|
|
66
|
+
* is not suitable (e.g. bridging to another runtime, configuring a third-party
|
|
67
|
+
* library, or providing the broker address to an external process).
|
|
68
|
+
*
|
|
69
|
+
* Mirrors the OCPP `getAvailableConnectionDetails` API.
|
|
70
|
+
*
|
|
71
|
+
* @returns A map of available broker connection details, keyed by scope (e.g. `local`).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const details = await mqtt.getAvailableConnectionDetails();
|
|
76
|
+
* if (details.local) {
|
|
77
|
+
* console.log(`Local broker available at ${details.local.url}`);
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
getAvailableConnectionDetails: () => Promise<EnyoMqttAvailableConnectionDetails>;
|
|
62
82
|
}
|
|
63
83
|
/**
|
|
64
84
|
* Represents an active MQTT client connection.
|
|
@@ -106,6 +106,8 @@ var EnyoChargeModeEnum;
|
|
|
106
106
|
EnyoChargeModeEnum["CostOptimized"] = "cost-optimized";
|
|
107
107
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
108
108
|
EnyoChargeModeEnum["PriceLimit"] = "price-limit";
|
|
109
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
110
|
+
EnyoChargeModeEnum["PvSurplus"] = "pv-surplus";
|
|
109
111
|
})(EnyoChargeModeEnum || (exports.EnyoChargeModeEnum = EnyoChargeModeEnum = {}));
|
|
110
112
|
var EnyoDataBusMessageEnum;
|
|
111
113
|
(function (EnyoDataBusMessageEnum) {
|
|
@@ -122,7 +122,9 @@ export declare enum EnyoChargeModeEnum {
|
|
|
122
122
|
/** Optimize charging schedule for lowest cost */
|
|
123
123
|
CostOptimized = "cost-optimized",
|
|
124
124
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
125
|
-
PriceLimit = "price-limit"
|
|
125
|
+
PriceLimit = "price-limit",
|
|
126
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
127
|
+
PvSurplus = "pv-surplus"
|
|
126
128
|
}
|
|
127
129
|
export interface EnyoAggregatedStateApplianceValues {
|
|
128
130
|
gridPowerW?: number;
|
|
@@ -84,6 +84,34 @@ export interface MqttPublishOptions {
|
|
|
84
84
|
/** Whether the broker should retain this message as the last known value for the topic (default: false) */
|
|
85
85
|
retain?: boolean;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Connection details for an MQTT broker exposed to the energy app.
|
|
89
|
+
* Returned by {@link EnergyAppMqtt.getAvailableConnectionDetails} so callers can
|
|
90
|
+
* connect to the broker using their own MQTT client implementation if needed.
|
|
91
|
+
*/
|
|
92
|
+
export interface EnyoMqttAvailableConnectionDetail {
|
|
93
|
+
/** Fully qualified broker URL including protocol and port (e.g. "mqtt://127.0.0.1:1883" or "mqtts://broker.local:8883") */
|
|
94
|
+
url: string;
|
|
95
|
+
/** Broker hostname or IP address (e.g. "127.0.0.1") */
|
|
96
|
+
host: string;
|
|
97
|
+
/** Broker TCP port (e.g. 1883 for plain, 8883 for TLS) */
|
|
98
|
+
port: number;
|
|
99
|
+
/** Whether the broker requires a TLS/SSL connection */
|
|
100
|
+
secure: boolean;
|
|
101
|
+
/** Username for broker authentication, if required */
|
|
102
|
+
username?: string;
|
|
103
|
+
/** Password for broker authentication, if required */
|
|
104
|
+
password?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Map of available MQTT broker connection details by scope.
|
|
108
|
+
* Mirrors the structure of OCPP available connection details so callers can
|
|
109
|
+
* uniformly discover broker endpoints exposed by the runtime.
|
|
110
|
+
*/
|
|
111
|
+
export interface EnyoMqttAvailableConnectionDetails {
|
|
112
|
+
/** Connection details for the SDK-provided local MQTT broker, when available */
|
|
113
|
+
local?: EnyoMqttAvailableConnectionDetail;
|
|
114
|
+
}
|
|
87
115
|
/**
|
|
88
116
|
* Represents an incoming MQTT message received on a subscribed topic.
|
|
89
117
|
*/
|
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.119';
|
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage } from "../types/enyo-mqtt.js";
|
|
1
|
+
import { MqttConnectOptions, MqttExternalConnectOptions, MqttConnectionStatus, MqttSubscribeOptions, MqttPublishOptions, MqttMessage, EnyoMqttAvailableConnectionDetails } from "../types/enyo-mqtt.js";
|
|
2
2
|
/**
|
|
3
3
|
* Interface for MQTT communication in enyo packages.
|
|
4
4
|
* Provides MQTT client functionality with support for both the SDK-provided
|
|
@@ -59,6 +59,26 @@ export interface EnergyAppMqtt {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
connect: (options: MqttExternalConnectOptions) => Promise<EnergyAppMqttClient>;
|
|
62
|
+
/**
|
|
63
|
+
* Get connection details for MQTT brokers exposed to the energy app.
|
|
64
|
+
* Currently returns details for the SDK-provided local MQTT broker so callers
|
|
65
|
+
* can connect with their own MQTT client implementation when {@link connectInternal}
|
|
66
|
+
* is not suitable (e.g. bridging to another runtime, configuring a third-party
|
|
67
|
+
* library, or providing the broker address to an external process).
|
|
68
|
+
*
|
|
69
|
+
* Mirrors the OCPP `getAvailableConnectionDetails` API.
|
|
70
|
+
*
|
|
71
|
+
* @returns A map of available broker connection details, keyed by scope (e.g. `local`).
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* const details = await mqtt.getAvailableConnectionDetails();
|
|
76
|
+
* if (details.local) {
|
|
77
|
+
* console.log(`Local broker available at ${details.local.url}`);
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
getAvailableConnectionDetails: () => Promise<EnyoMqttAvailableConnectionDetails>;
|
|
62
82
|
}
|
|
63
83
|
/**
|
|
64
84
|
* Represents an active MQTT client connection.
|
|
@@ -122,7 +122,9 @@ export declare enum EnyoChargeModeEnum {
|
|
|
122
122
|
/** Optimize charging schedule for lowest cost */
|
|
123
123
|
CostOptimized = "cost-optimized",
|
|
124
124
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
125
|
-
PriceLimit = "price-limit"
|
|
125
|
+
PriceLimit = "price-limit",
|
|
126
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
127
|
+
PvSurplus = "pv-surplus"
|
|
126
128
|
}
|
|
127
129
|
export interface EnyoAggregatedStateApplianceValues {
|
|
128
130
|
gridPowerW?: number;
|
|
@@ -103,6 +103,8 @@ export var EnyoChargeModeEnum;
|
|
|
103
103
|
EnyoChargeModeEnum["CostOptimized"] = "cost-optimized";
|
|
104
104
|
/** Optimize charging schedule for a maximum price limit, for example 7 ct grid or pv production */
|
|
105
105
|
EnyoChargeModeEnum["PriceLimit"] = "price-limit";
|
|
106
|
+
/** Charge only from PV surplus, using excess solar production that would otherwise be fed into the grid */
|
|
107
|
+
EnyoChargeModeEnum["PvSurplus"] = "pv-surplus";
|
|
106
108
|
})(EnyoChargeModeEnum || (EnyoChargeModeEnum = {}));
|
|
107
109
|
export var EnyoDataBusMessageEnum;
|
|
108
110
|
(function (EnyoDataBusMessageEnum) {
|
|
@@ -84,6 +84,34 @@ export interface MqttPublishOptions {
|
|
|
84
84
|
/** Whether the broker should retain this message as the last known value for the topic (default: false) */
|
|
85
85
|
retain?: boolean;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Connection details for an MQTT broker exposed to the energy app.
|
|
89
|
+
* Returned by {@link EnergyAppMqtt.getAvailableConnectionDetails} so callers can
|
|
90
|
+
* connect to the broker using their own MQTT client implementation if needed.
|
|
91
|
+
*/
|
|
92
|
+
export interface EnyoMqttAvailableConnectionDetail {
|
|
93
|
+
/** Fully qualified broker URL including protocol and port (e.g. "mqtt://127.0.0.1:1883" or "mqtts://broker.local:8883") */
|
|
94
|
+
url: string;
|
|
95
|
+
/** Broker hostname or IP address (e.g. "127.0.0.1") */
|
|
96
|
+
host: string;
|
|
97
|
+
/** Broker TCP port (e.g. 1883 for plain, 8883 for TLS) */
|
|
98
|
+
port: number;
|
|
99
|
+
/** Whether the broker requires a TLS/SSL connection */
|
|
100
|
+
secure: boolean;
|
|
101
|
+
/** Username for broker authentication, if required */
|
|
102
|
+
username?: string;
|
|
103
|
+
/** Password for broker authentication, if required */
|
|
104
|
+
password?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Map of available MQTT broker connection details by scope.
|
|
108
|
+
* Mirrors the structure of OCPP available connection details so callers can
|
|
109
|
+
* uniformly discover broker endpoints exposed by the runtime.
|
|
110
|
+
*/
|
|
111
|
+
export interface EnyoMqttAvailableConnectionDetails {
|
|
112
|
+
/** Connection details for the SDK-provided local MQTT broker, when available */
|
|
113
|
+
local?: EnyoMqttAvailableConnectionDetail;
|
|
114
|
+
}
|
|
87
115
|
/**
|
|
88
116
|
* Represents an incoming MQTT message received on a subscribed topic.
|
|
89
117
|
*/
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED