myio-js-library 0.1.212 → 0.1.213
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/index.cjs +8 -13
- package/dist/index.js +8 -13
- package/dist/myio-js-library.umd.js +8 -13
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -22301,13 +22301,12 @@ var WaterTankModal = class {
|
|
|
22301
22301
|
}
|
|
22302
22302
|
/**
|
|
22303
22303
|
* Transform raw ThingsBoard response to our data points
|
|
22304
|
-
* RFC-0107:
|
|
22304
|
+
* RFC-0107: Keep ALL data points with their original keys (no deduplication)
|
|
22305
|
+
* This allows the chart to switch between water_level and water_percentage dynamically
|
|
22305
22306
|
*/
|
|
22306
22307
|
transformTelemetryData(rawData, keys) {
|
|
22307
22308
|
const allPoints = [];
|
|
22308
|
-
const
|
|
22309
|
-
const prioritizedKeys = displayKey && rawData[displayKey] ? [displayKey, ...keys.filter((k) => k !== displayKey)] : keys;
|
|
22310
|
-
for (const key of prioritizedKeys) {
|
|
22309
|
+
for (const key of keys) {
|
|
22311
22310
|
if (rawData[key] && Array.isArray(rawData[key])) {
|
|
22312
22311
|
const keyPoints = rawData[key].map((point) => {
|
|
22313
22312
|
let value = typeof point.value === "string" ? parseFloat(point.value) : point.value;
|
|
@@ -22324,16 +22323,12 @@ var WaterTankModal = class {
|
|
|
22324
22323
|
}
|
|
22325
22324
|
}
|
|
22326
22325
|
allPoints.sort((a, b) => a.ts - b.ts);
|
|
22327
|
-
const
|
|
22328
|
-
const
|
|
22329
|
-
|
|
22330
|
-
if (!seenTimestamps.has(point.ts)) {
|
|
22331
|
-
seenTimestamps.add(point.ts);
|
|
22332
|
-
uniquePoints.push(point);
|
|
22333
|
-
}
|
|
22326
|
+
const keyCounts = {};
|
|
22327
|
+
for (const p of allPoints) {
|
|
22328
|
+
keyCounts[p.key || "unknown"] = (keyCounts[p.key || "unknown"] || 0) + 1;
|
|
22334
22329
|
}
|
|
22335
|
-
console.log(`[WaterTankModal] Transformed ${
|
|
22336
|
-
return
|
|
22330
|
+
console.log(`[WaterTankModal] Transformed ${allPoints.length} total points:`, keyCounts);
|
|
22331
|
+
return allPoints;
|
|
22337
22332
|
}
|
|
22338
22333
|
/**
|
|
22339
22334
|
* Calculate summary statistics from telemetry data
|
package/dist/index.js
CHANGED
|
@@ -22129,13 +22129,12 @@ var WaterTankModal = class {
|
|
|
22129
22129
|
}
|
|
22130
22130
|
/**
|
|
22131
22131
|
* Transform raw ThingsBoard response to our data points
|
|
22132
|
-
* RFC-0107:
|
|
22132
|
+
* RFC-0107: Keep ALL data points with their original keys (no deduplication)
|
|
22133
|
+
* This allows the chart to switch between water_level and water_percentage dynamically
|
|
22133
22134
|
*/
|
|
22134
22135
|
transformTelemetryData(rawData, keys) {
|
|
22135
22136
|
const allPoints = [];
|
|
22136
|
-
const
|
|
22137
|
-
const prioritizedKeys = displayKey && rawData[displayKey] ? [displayKey, ...keys.filter((k) => k !== displayKey)] : keys;
|
|
22138
|
-
for (const key of prioritizedKeys) {
|
|
22137
|
+
for (const key of keys) {
|
|
22139
22138
|
if (rawData[key] && Array.isArray(rawData[key])) {
|
|
22140
22139
|
const keyPoints = rawData[key].map((point) => {
|
|
22141
22140
|
let value = typeof point.value === "string" ? parseFloat(point.value) : point.value;
|
|
@@ -22152,16 +22151,12 @@ var WaterTankModal = class {
|
|
|
22152
22151
|
}
|
|
22153
22152
|
}
|
|
22154
22153
|
allPoints.sort((a, b) => a.ts - b.ts);
|
|
22155
|
-
const
|
|
22156
|
-
const
|
|
22157
|
-
|
|
22158
|
-
if (!seenTimestamps.has(point.ts)) {
|
|
22159
|
-
seenTimestamps.add(point.ts);
|
|
22160
|
-
uniquePoints.push(point);
|
|
22161
|
-
}
|
|
22154
|
+
const keyCounts = {};
|
|
22155
|
+
for (const p of allPoints) {
|
|
22156
|
+
keyCounts[p.key || "unknown"] = (keyCounts[p.key || "unknown"] || 0) + 1;
|
|
22162
22157
|
}
|
|
22163
|
-
console.log(`[WaterTankModal] Transformed ${
|
|
22164
|
-
return
|
|
22158
|
+
console.log(`[WaterTankModal] Transformed ${allPoints.length} total points:`, keyCounts);
|
|
22159
|
+
return allPoints;
|
|
22165
22160
|
}
|
|
22166
22161
|
/**
|
|
22167
22162
|
* Calculate summary statistics from telemetry data
|
|
@@ -21943,13 +21943,12 @@
|
|
|
21943
21943
|
}
|
|
21944
21944
|
/**
|
|
21945
21945
|
* Transform raw ThingsBoard response to our data points
|
|
21946
|
-
* RFC-0107:
|
|
21946
|
+
* RFC-0107: Keep ALL data points with their original keys (no deduplication)
|
|
21947
|
+
* This allows the chart to switch between water_level and water_percentage dynamically
|
|
21947
21948
|
*/
|
|
21948
21949
|
transformTelemetryData(rawData, keys) {
|
|
21949
21950
|
const allPoints = [];
|
|
21950
|
-
const
|
|
21951
|
-
const prioritizedKeys = rawData[displayKey] ? [displayKey, ...keys.filter((k) => k !== displayKey)] : keys;
|
|
21952
|
-
for (const key of prioritizedKeys) {
|
|
21951
|
+
for (const key of keys) {
|
|
21953
21952
|
if (rawData[key] && Array.isArray(rawData[key])) {
|
|
21954
21953
|
const keyPoints = rawData[key].map((point) => {
|
|
21955
21954
|
let value = typeof point.value === "string" ? parseFloat(point.value) : point.value;
|
|
@@ -21966,16 +21965,12 @@
|
|
|
21966
21965
|
}
|
|
21967
21966
|
}
|
|
21968
21967
|
allPoints.sort((a, b) => a.ts - b.ts);
|
|
21969
|
-
const
|
|
21970
|
-
const
|
|
21971
|
-
|
|
21972
|
-
if (!seenTimestamps.has(point.ts)) {
|
|
21973
|
-
seenTimestamps.add(point.ts);
|
|
21974
|
-
uniquePoints.push(point);
|
|
21975
|
-
}
|
|
21968
|
+
const keyCounts = {};
|
|
21969
|
+
for (const p of allPoints) {
|
|
21970
|
+
keyCounts[p.key || "unknown"] = (keyCounts[p.key || "unknown"] || 0) + 1;
|
|
21976
21971
|
}
|
|
21977
|
-
console.log(`[WaterTankModal] Transformed ${
|
|
21978
|
-
return
|
|
21972
|
+
console.log(`[WaterTankModal] Transformed ${allPoints.length} total points:`, keyCounts);
|
|
21973
|
+
return allPoints;
|
|
21979
21974
|
}
|
|
21980
21975
|
/**
|
|
21981
21976
|
* Calculate summary statistics from telemetry data
|