myio-js-library 0.1.207 → 0.1.209

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
@@ -1572,7 +1572,7 @@ function isDeviceOffline(deviceStatus) {
1572
1572
  }
1573
1573
  function getDeviceStatusIcon(deviceStatus, deviceType = null) {
1574
1574
  const normalizedType = deviceType?.toUpperCase() || "";
1575
- const isWaterDevice = normalizedType === "TANK" || normalizedType === "CAIXA_DAGUA" || normalizedType === "HIDROMETRO";
1575
+ const isWaterDevice = normalizedType === "TANK" || normalizedType === "CAIXA_DAGUA" || normalizedType === "HIDROMETRO" || normalizedType === "HIDROMETRO_AREA_COMUM" || normalizedType === "HIDROMETRO_SHOPPING" || normalizedType.startsWith("HIDROMETRO_");
1576
1576
  const isTemperatureDevice = normalizedType === "TERMOSTATO";
1577
1577
  let iconMap;
1578
1578
  if (isWaterDevice) {
@@ -11947,6 +11947,14 @@ var DEVICE_TYPE_CONFIG = {
11947
11947
  category: "water",
11948
11948
  image: "https://dashboard.myio-bas.com/api/images/public/aMQYFJbGHs9gQbQkMn6XseAlUZHanBR4"
11949
11949
  },
11950
+ HIDROMETRO_AREA_COMUM: {
11951
+ category: "water",
11952
+ image: "https://dashboard.myio-bas.com/api/images/public/IbEhjsvixAxwKg1ntGGZc5xZwwvGKv2t"
11953
+ },
11954
+ HIDROMETRO_SHOPPING: {
11955
+ category: "water",
11956
+ image: "https://dashboard.myio-bas.com/api/images/public/OIMmvN4ZTKYDvrpPGYY5agqMRoSaWNTI"
11957
+ },
11950
11958
  CAIXA_DAGUA: {
11951
11959
  category: "water",
11952
11960
  image: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq"
@@ -12135,6 +12143,10 @@ function renderCardComponentV5({
12135
12143
  const isTemperatureDevice = (deviceType2) => isTemperatureDeviceType(deviceType2);
12136
12144
  const formatCardValue = (value, deviceType2) => {
12137
12145
  const numValue = Number(value) || 0;
12146
+ const category = getDeviceCategory(deviceType2);
12147
+ if (category !== "energy" && category !== "temperature") {
12148
+ console.log(`[template-card-v5] formatCardValue: deviceType=${deviceType2}, category=${category}, isEnergy=${isEnergyDevice(deviceType2)}`);
12149
+ }
12138
12150
  if (isEnergyDevice(deviceType2)) {
12139
12151
  return formatEnergy(numValue);
12140
12152
  } else if (isTemperatureDevice(deviceType2)) {
@@ -12473,7 +12485,9 @@ function renderCardComponentV5({
12473
12485
  <span class="consumption-value">${formatCardValue(cardEntity.lastValue, deviceType)}</span>
12474
12486
  </div>
12475
12487
  </div>
12476
- ${!isTermostatoDevice ? `<span class="device-percentage-badge percentage-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; cursor: help;">${percentageForDisplay.toFixed(1)}%</span>` : tempDeviationPercent ? `<span class="device-percentage-badge temp-deviation-badge temp-comparison-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; color: ${tempDeviationPercent.isAbove ? "#ef4444" : tempDeviationPercent.isBelow ? "#3b82f6" : "#6b7280"}; font-weight: 600; cursor: help;">${tempDeviationPercent.sign}${tempDeviationPercent.value.toFixed(1)}%</span>` : ""}
12488
+ ${!isTermostatoDevice ? `<span class="device-percentage-badge percentage-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; cursor: help;">${percentageForDisplay.toFixed(
12489
+ 1
12490
+ )}%</span>` : tempDeviationPercent ? `<span class="device-percentage-badge temp-deviation-badge temp-comparison-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; color: ${tempDeviationPercent.isAbove ? "#ef4444" : tempDeviationPercent.isBelow ? "#3b82f6" : "#6b7280"}; font-weight: 600; cursor: help;">${tempDeviationPercent.sign}${tempDeviationPercent.value.toFixed(1)}%</span>` : ""}
12477
12491
  </div>
12478
12492
  </div>
12479
12493
  </div>
package/dist/index.js CHANGED
@@ -1400,7 +1400,7 @@ function isDeviceOffline(deviceStatus) {
1400
1400
  }
1401
1401
  function getDeviceStatusIcon(deviceStatus, deviceType = null) {
1402
1402
  const normalizedType = deviceType?.toUpperCase() || "";
1403
- const isWaterDevice = normalizedType === "TANK" || normalizedType === "CAIXA_DAGUA" || normalizedType === "HIDROMETRO";
1403
+ const isWaterDevice = normalizedType === "TANK" || normalizedType === "CAIXA_DAGUA" || normalizedType === "HIDROMETRO" || normalizedType === "HIDROMETRO_AREA_COMUM" || normalizedType === "HIDROMETRO_SHOPPING" || normalizedType.startsWith("HIDROMETRO_");
1404
1404
  const isTemperatureDevice = normalizedType === "TERMOSTATO";
1405
1405
  let iconMap;
1406
1406
  if (isWaterDevice) {
@@ -11775,6 +11775,14 @@ var DEVICE_TYPE_CONFIG = {
11775
11775
  category: "water",
11776
11776
  image: "https://dashboard.myio-bas.com/api/images/public/aMQYFJbGHs9gQbQkMn6XseAlUZHanBR4"
11777
11777
  },
11778
+ HIDROMETRO_AREA_COMUM: {
11779
+ category: "water",
11780
+ image: "https://dashboard.myio-bas.com/api/images/public/IbEhjsvixAxwKg1ntGGZc5xZwwvGKv2t"
11781
+ },
11782
+ HIDROMETRO_SHOPPING: {
11783
+ category: "water",
11784
+ image: "https://dashboard.myio-bas.com/api/images/public/OIMmvN4ZTKYDvrpPGYY5agqMRoSaWNTI"
11785
+ },
11778
11786
  CAIXA_DAGUA: {
11779
11787
  category: "water",
11780
11788
  image: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq"
@@ -11963,6 +11971,10 @@ function renderCardComponentV5({
11963
11971
  const isTemperatureDevice = (deviceType2) => isTemperatureDeviceType(deviceType2);
11964
11972
  const formatCardValue = (value, deviceType2) => {
11965
11973
  const numValue = Number(value) || 0;
11974
+ const category = getDeviceCategory(deviceType2);
11975
+ if (category !== "energy" && category !== "temperature") {
11976
+ console.log(`[template-card-v5] formatCardValue: deviceType=${deviceType2}, category=${category}, isEnergy=${isEnergyDevice(deviceType2)}`);
11977
+ }
11966
11978
  if (isEnergyDevice(deviceType2)) {
11967
11979
  return formatEnergy(numValue);
11968
11980
  } else if (isTemperatureDevice(deviceType2)) {
@@ -12301,7 +12313,9 @@ function renderCardComponentV5({
12301
12313
  <span class="consumption-value">${formatCardValue(cardEntity.lastValue, deviceType)}</span>
12302
12314
  </div>
12303
12315
  </div>
12304
- ${!isTermostatoDevice ? `<span class="device-percentage-badge percentage-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; cursor: help;">${percentageForDisplay.toFixed(1)}%</span>` : tempDeviationPercent ? `<span class="device-percentage-badge temp-deviation-badge temp-comparison-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; color: ${tempDeviationPercent.isAbove ? "#ef4444" : tempDeviationPercent.isBelow ? "#3b82f6" : "#6b7280"}; font-weight: 600; cursor: help;">${tempDeviationPercent.sign}${tempDeviationPercent.value.toFixed(1)}%</span>` : ""}
12316
+ ${!isTermostatoDevice ? `<span class="device-percentage-badge percentage-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; cursor: help;">${percentageForDisplay.toFixed(
12317
+ 1
12318
+ )}%</span>` : tempDeviationPercent ? `<span class="device-percentage-badge temp-deviation-badge temp-comparison-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; color: ${tempDeviationPercent.isAbove ? "#ef4444" : tempDeviationPercent.isBelow ? "#3b82f6" : "#6b7280"}; font-weight: 600; cursor: help;">${tempDeviationPercent.sign}${tempDeviationPercent.value.toFixed(1)}%</span>` : ""}
12305
12319
  </div>
12306
12320
  </div>
12307
12321
  </div>
@@ -1406,7 +1406,7 @@
1406
1406
  }
1407
1407
  function getDeviceStatusIcon(deviceStatus, deviceType = null) {
1408
1408
  const normalizedType = deviceType?.toUpperCase() || "";
1409
- const isWaterDevice = normalizedType === "TANK" || normalizedType === "CAIXA_DAGUA" || normalizedType === "HIDROMETRO";
1409
+ const isWaterDevice = normalizedType === "TANK" || normalizedType === "CAIXA_DAGUA" || normalizedType === "HIDROMETRO" || normalizedType === "HIDROMETRO_AREA_COMUM" || normalizedType === "HIDROMETRO_SHOPPING" || normalizedType.startsWith("HIDROMETRO_");
1410
1410
  const isTemperatureDevice = normalizedType === "TERMOSTATO";
1411
1411
  let iconMap;
1412
1412
  if (isWaterDevice) {
@@ -11763,6 +11763,14 @@
11763
11763
  category: "water",
11764
11764
  image: "https://dashboard.myio-bas.com/api/images/public/aMQYFJbGHs9gQbQkMn6XseAlUZHanBR4"
11765
11765
  },
11766
+ HIDROMETRO_AREA_COMUM: {
11767
+ category: "water",
11768
+ image: "https://dashboard.myio-bas.com/api/images/public/IbEhjsvixAxwKg1ntGGZc5xZwwvGKv2t"
11769
+ },
11770
+ HIDROMETRO_SHOPPING: {
11771
+ category: "water",
11772
+ image: "https://dashboard.myio-bas.com/api/images/public/OIMmvN4ZTKYDvrpPGYY5agqMRoSaWNTI"
11773
+ },
11766
11774
  CAIXA_DAGUA: {
11767
11775
  category: "water",
11768
11776
  image: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq"
@@ -11951,6 +11959,10 @@
11951
11959
  const isTemperatureDevice = (deviceType2) => isTemperatureDeviceType(deviceType2);
11952
11960
  const formatCardValue = (value, deviceType2) => {
11953
11961
  const numValue = Number(value) || 0;
11962
+ const category = getDeviceCategory(deviceType2);
11963
+ if (category !== "energy" && category !== "temperature") {
11964
+ console.log(`[template-card-v5] formatCardValue: deviceType=${deviceType2}, category=${category}, isEnergy=${isEnergyDevice(deviceType2)}`);
11965
+ }
11954
11966
  if (isEnergyDevice(deviceType2)) {
11955
11967
  return formatEnergy(numValue);
11956
11968
  } else if (isTemperatureDevice(deviceType2)) {
@@ -12289,7 +12301,9 @@
12289
12301
  <span class="consumption-value">${formatCardValue(cardEntity.lastValue, deviceType)}</span>
12290
12302
  </div>
12291
12303
  </div>
12292
- ${!isTermostatoDevice ? `<span class="device-percentage-badge percentage-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; cursor: help;">${percentageForDisplay.toFixed(1)}%</span>` : tempDeviationPercent ? `<span class="device-percentage-badge temp-deviation-badge temp-comparison-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; color: ${tempDeviationPercent.isAbove ? "#ef4444" : tempDeviationPercent.isBelow ? "#3b82f6" : "#6b7280"}; font-weight: 600; cursor: help;">${tempDeviationPercent.sign}${tempDeviationPercent.value.toFixed(1)}%</span>` : ""}
12304
+ ${!isTermostatoDevice ? `<span class="device-percentage-badge percentage-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; cursor: help;">${percentageForDisplay.toFixed(
12305
+ 1
12306
+ )}%</span>` : tempDeviationPercent ? `<span class="device-percentage-badge temp-deviation-badge temp-comparison-tooltip-trigger" style="position: absolute; bottom: 12px; right: 12px; z-index: 20; background: none !important; color: ${tempDeviationPercent.isAbove ? "#ef4444" : tempDeviationPercent.isBelow ? "#3b82f6" : "#6b7280"}; font-weight: 600; cursor: help;">${tempDeviationPercent.sign}${tempDeviationPercent.value.toFixed(1)}%</span>` : ""}
12293
12307
  </div>
12294
12308
  </div>
12295
12309
  </div>