@aurora-blue/signalk-connector 0.2.0-dev.43 → 0.2.0-dev.44
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/VERSION +1 -1
- package/dist/src/connector.d.ts +1 -0
- package/dist/src/connector.js +14 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.0-dev.
|
|
1
|
+
0.2.0-dev.44
|
package/dist/src/connector.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare class ConnectorRuntime {
|
|
|
51
51
|
private readonly autoSchedule;
|
|
52
52
|
private readonly anchorAlarm;
|
|
53
53
|
private readonly telemetryReducer;
|
|
54
|
+
private readonly nmeaEnergyReducer;
|
|
54
55
|
private readonly monotonicNow;
|
|
55
56
|
private filesystemCapacity;
|
|
56
57
|
private nextCapacityRefreshAt;
|
package/dist/src/connector.js
CHANGED
|
@@ -67,6 +67,7 @@ class ConnectorRuntime {
|
|
|
67
67
|
autoSchedule;
|
|
68
68
|
anchorAlarm;
|
|
69
69
|
telemetryReducer;
|
|
70
|
+
nmeaEnergyReducer;
|
|
70
71
|
monotonicNow;
|
|
71
72
|
filesystemCapacity = null;
|
|
72
73
|
nextCapacityRefreshAt = 0;
|
|
@@ -93,6 +94,7 @@ class ConnectorRuntime {
|
|
|
93
94
|
const startedAt = Date.parse(this.now());
|
|
94
95
|
this.anchorAlarm = new anchor_alarm_1.AnchorAlarmEngine(config.anchorAlarm, Number.isFinite(startedAt) ? startedAt : Date.now());
|
|
95
96
|
this.telemetryReducer = new telemetry_reducer_1.TelemetryReducer(config.adaptiveTelemetryEnabled, (0, telemetry_reducer_1.rulesForProfile)(config.operatingProfile));
|
|
97
|
+
this.nmeaEnergyReducer = new telemetry_reducer_1.TelemetryReducer(true, (0, telemetry_reducer_1.rulesForProfile)(config.operatingProfile));
|
|
96
98
|
this.storageBudget = (0, storage_budget_1.resolveStorageBudget)(this.storageBudgetPolicy(), { events: 0, bytes: 0, averageRecordBytes: null }, null);
|
|
97
99
|
}
|
|
98
100
|
async start() {
|
|
@@ -753,6 +755,17 @@ class ConnectorRuntime {
|
|
|
753
755
|
return;
|
|
754
756
|
if (this.nmeaEnergySupported) {
|
|
755
757
|
for (const observation of this.nmeaEnergy.observe(message, this.app.getPath("/sources"), Date.parse(this.now()))) {
|
|
758
|
+
const event = {
|
|
759
|
+
boot_id: this.bootId,
|
|
760
|
+
context: "vessels.self",
|
|
761
|
+
path: observation.path,
|
|
762
|
+
value: observation.value,
|
|
763
|
+
source_timestamp: observation.at,
|
|
764
|
+
received_at: this.now(),
|
|
765
|
+
source: observation.source,
|
|
766
|
+
};
|
|
767
|
+
if (!this.nmeaEnergyReducer.shouldEmit(event))
|
|
768
|
+
continue;
|
|
756
769
|
this.app.handleMessage("aurora-blue-signalk-connector", {
|
|
757
770
|
context: "vessels.self",
|
|
758
771
|
updates: [
|
|
@@ -765,6 +778,7 @@ class ConnectorRuntime {
|
|
|
765
778
|
},
|
|
766
779
|
],
|
|
767
780
|
});
|
|
781
|
+
this.nmeaEnergyReducer.record(event);
|
|
768
782
|
}
|
|
769
783
|
}
|
|
770
784
|
if (!this.victronInputLimitSupported)
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CONNECTOR_VERSION = "0.2.0-dev.
|
|
1
|
+
export declare const CONNECTOR_VERSION = "0.2.0-dev.44";
|
package/dist/src/version.js
CHANGED
package/package.json
CHANGED