myio-js-library 0.1.143 → 0.1.144

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
@@ -4811,6 +4811,12 @@ function normalizeParams(params) {
4811
4811
  function getIconSvg(deviceType) {
4812
4812
  return ICON_MAP[deviceType] || ICON_MAP.DEFAULT;
4813
4813
  }
4814
+ function formatValueByDomain(value, domain) {
4815
+ if (domain === "water") {
4816
+ return formatWaterVolumeM3(value);
4817
+ }
4818
+ return formatEnergy(value);
4819
+ }
4814
4820
  function formatUpdateDate(timeVal) {
4815
4821
  let telemetryTimeFormatted = "N/A";
4816
4822
  let timeSinceLastTelemetry = "";
@@ -5059,7 +5065,7 @@ function paint(root, state) {
5059
5065
  const chip = root.querySelector(".chip");
5060
5066
  chip.className = `chip ${statusInfo.chipClass}`;
5061
5067
  chip.textContent = statusInfo.label;
5062
- const primaryValue = formatEnergy(entityObject.val);
5068
+ const primaryValue = formatValueByDomain(entityObject.val, entityObject.domain);
5063
5069
  const numSpan = root.querySelector(".myio-ho-card__value .num");
5064
5070
  const unitSpan = root.querySelector(".myio-ho-card__value .unit");
5065
5071
  numSpan.textContent = primaryValue;
package/dist/index.js CHANGED
@@ -4703,6 +4703,12 @@ function normalizeParams(params) {
4703
4703
  function getIconSvg(deviceType) {
4704
4704
  return ICON_MAP[deviceType] || ICON_MAP.DEFAULT;
4705
4705
  }
4706
+ function formatValueByDomain(value, domain) {
4707
+ if (domain === "water") {
4708
+ return formatWaterVolumeM3(value);
4709
+ }
4710
+ return formatEnergy(value);
4711
+ }
4706
4712
  function formatUpdateDate(timeVal) {
4707
4713
  let telemetryTimeFormatted = "N/A";
4708
4714
  let timeSinceLastTelemetry = "";
@@ -4951,7 +4957,7 @@ function paint(root, state) {
4951
4957
  const chip = root.querySelector(".chip");
4952
4958
  chip.className = `chip ${statusInfo.chipClass}`;
4953
4959
  chip.textContent = statusInfo.label;
4954
- const primaryValue = formatEnergy(entityObject.val);
4960
+ const primaryValue = formatValueByDomain(entityObject.val, entityObject.domain);
4955
4961
  const numSpan = root.querySelector(".myio-ho-card__value .num");
4956
4962
  const unitSpan = root.querySelector(".myio-ho-card__value .unit");
4957
4963
  numSpan.textContent = primaryValue;
@@ -4701,6 +4701,12 @@
4701
4701
  function getIconSvg(deviceType) {
4702
4702
  return ICON_MAP[deviceType] || ICON_MAP.DEFAULT;
4703
4703
  }
4704
+ function formatValueByDomain(value, domain) {
4705
+ if (domain === "water") {
4706
+ return formatWaterVolumeM3(value);
4707
+ }
4708
+ return formatEnergy(value);
4709
+ }
4704
4710
  function formatUpdateDate(timeVal) {
4705
4711
  let telemetryTimeFormatted = "N/A";
4706
4712
  let timeSinceLastTelemetry = "";
@@ -4949,7 +4955,7 @@
4949
4955
  const chip = root.querySelector(".chip");
4950
4956
  chip.className = `chip ${statusInfo.chipClass}`;
4951
4957
  chip.textContent = statusInfo.label;
4952
- const primaryValue = formatEnergy(entityObject.val);
4958
+ const primaryValue = formatValueByDomain(entityObject.val, entityObject.domain);
4953
4959
  const numSpan = root.querySelector(".myio-ho-card__value .num");
4954
4960
  root.querySelector(".myio-ho-card__value .unit");
4955
4961
  numSpan.textContent = primaryValue;