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 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: Support displayKey option to choose between water_level or water_percentage
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 displayKey = this.options.displayKey || "water_percentage";
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 uniquePoints = [];
22328
- const seenTimestamps = /* @__PURE__ */ new Set();
22329
- for (const point of allPoints) {
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 ${uniquePoints.length} points, displayKey: ${displayKey}`);
22336
- return uniquePoints;
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: Support displayKey option to choose between water_level or water_percentage
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 displayKey = this.options.displayKey || "water_percentage";
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 uniquePoints = [];
22156
- const seenTimestamps = /* @__PURE__ */ new Set();
22157
- for (const point of allPoints) {
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 ${uniquePoints.length} points, displayKey: ${displayKey}`);
22164
- return uniquePoints;
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: Support displayKey option to choose between water_level or water_percentage
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 displayKey = this.options.displayKey || "water_percentage";
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 uniquePoints = [];
21970
- const seenTimestamps = /* @__PURE__ */ new Set();
21971
- for (const point of allPoints) {
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 ${uniquePoints.length} points, displayKey: ${displayKey}`);
21978
- return uniquePoints;
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