@enyo-energy/sunspec-sdk 0.0.76 → 0.0.77
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.
|
@@ -133,6 +133,22 @@ class SunspecBatteryScheduleHandler extends storage_schedule_handler_js_1.Storag
|
|
|
133
133
|
}
|
|
134
134
|
async applyEntry(active) {
|
|
135
135
|
const { direction, powerW } = active.entry;
|
|
136
|
+
if (direction === enyo_data_bus_value_js_1.EnyoStorageScheduleDirectionEnum.Idle) {
|
|
137
|
+
// Idle entry: hand the battery back to its own autonomous logic
|
|
138
|
+
// by restoring the snapshotted pre-schedule registers (same write
|
|
139
|
+
// set as the `mode: auto` rollback path). The schedule itself
|
|
140
|
+
// keeps running, so a subsequent Charge / Discharge entry can
|
|
141
|
+
// resume external control.
|
|
142
|
+
const baselineRegisters = this.originalBaseline;
|
|
143
|
+
if (!baselineRegisters) {
|
|
144
|
+
throw new Error(`no usable baseline for idle entry (originalBaseline=undefined)`);
|
|
145
|
+
}
|
|
146
|
+
await this.sunspecClient.writeBatteryControls(this.unitId, baselineRegisters);
|
|
147
|
+
await this.getSnapshotService()?.recordModification([
|
|
148
|
+
'storCtlMod', 'chaGriSet', 'wChaMax', 'inWRte', 'outWRte',
|
|
149
|
+
]);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
136
152
|
const baseline = this.installedWChaMax;
|
|
137
153
|
if (!baseline || baseline <= 0) {
|
|
138
154
|
throw new Error(`no usable wChaMax baseline (installedWChaMax=${baseline})`);
|
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.77';
|
|
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
|
@@ -130,6 +130,22 @@ export class SunspecBatteryScheduleHandler extends StorageScheduleHandler {
|
|
|
130
130
|
}
|
|
131
131
|
async applyEntry(active) {
|
|
132
132
|
const { direction, powerW } = active.entry;
|
|
133
|
+
if (direction === EnyoStorageScheduleDirectionEnum.Idle) {
|
|
134
|
+
// Idle entry: hand the battery back to its own autonomous logic
|
|
135
|
+
// by restoring the snapshotted pre-schedule registers (same write
|
|
136
|
+
// set as the `mode: auto` rollback path). The schedule itself
|
|
137
|
+
// keeps running, so a subsequent Charge / Discharge entry can
|
|
138
|
+
// resume external control.
|
|
139
|
+
const baselineRegisters = this.originalBaseline;
|
|
140
|
+
if (!baselineRegisters) {
|
|
141
|
+
throw new Error(`no usable baseline for idle entry (originalBaseline=undefined)`);
|
|
142
|
+
}
|
|
143
|
+
await this.sunspecClient.writeBatteryControls(this.unitId, baselineRegisters);
|
|
144
|
+
await this.getSnapshotService()?.recordModification([
|
|
145
|
+
'storCtlMod', 'chaGriSet', 'wChaMax', 'inWRte', 'outWRte',
|
|
146
|
+
]);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
133
149
|
const baseline = this.installedWChaMax;
|
|
134
150
|
if (!baseline || baseline <= 0) {
|
|
135
151
|
throw new Error(`no usable wChaMax baseline (installedWChaMax=${baseline})`);
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enyo-energy/sunspec-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
4
4
|
"description": "enyo Energy Sunspec SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@enyo-energy/appliance-calibration": "0.0.2",
|
|
44
|
-
"@enyo-energy/energy-app-sdk": "0.0.
|
|
44
|
+
"@enyo-energy/energy-app-sdk": "^0.0.149"
|
|
45
45
|
},
|
|
46
46
|
"volta": {
|
|
47
47
|
"node": "22.17.0"
|