myio-js-library 0.1.183 → 0.1.184
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 +114 -67
- package/dist/index.d.cts +5 -5
- package/dist/index.js +114 -67
- package/dist/myio-js-library.umd.js +114 -67
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7864,6 +7864,100 @@ function renderCardComponentHeadOffice(containerEl, params) {
|
|
|
7864
7864
|
|
|
7865
7865
|
// src/thingsboard/main-dashboard-shopping/v-5.2.0/card/template-card-v5.js
|
|
7866
7866
|
var LABEL_CHAR_LIMIT2 = 18;
|
|
7867
|
+
var DEVICE_TYPE_CONFIG = {
|
|
7868
|
+
// Energy devices
|
|
7869
|
+
COMPRESSOR: { category: "energy", image: null },
|
|
7870
|
+
VENTILADOR: { category: "energy", image: null },
|
|
7871
|
+
ESCADA_ROLANTE: {
|
|
7872
|
+
category: "energy",
|
|
7873
|
+
image: "https://dashboard.myio-bas.com/api/images/public/EJ997iB2HD1AYYUHwIloyQOOszeqb2jp"
|
|
7874
|
+
},
|
|
7875
|
+
ELEVADOR: {
|
|
7876
|
+
category: "energy",
|
|
7877
|
+
image: "https://dashboard.myio-bas.com/api/images/public/rAjOvdsYJLGah6w6BABPJSD9znIyrkJX"
|
|
7878
|
+
},
|
|
7879
|
+
MOTOR: {
|
|
7880
|
+
category: "energy",
|
|
7881
|
+
image: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT"
|
|
7882
|
+
},
|
|
7883
|
+
BOMBA_HIDRAULICA: {
|
|
7884
|
+
category: "energy",
|
|
7885
|
+
image: "https://dashboard.myio-bas.com/api/images/public/rbO2wQb6iKBtX0Ec04DFDcO3Qg04EOoD"
|
|
7886
|
+
},
|
|
7887
|
+
BOMBA_INCENDIO: {
|
|
7888
|
+
category: "energy",
|
|
7889
|
+
image: "https://dashboard.myio-bas.com/api/images/public/YJkELCk9kluQSM6QXaFINX6byQWI7vbB"
|
|
7890
|
+
},
|
|
7891
|
+
BOMBA: {
|
|
7892
|
+
category: "energy",
|
|
7893
|
+
image: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT"
|
|
7894
|
+
},
|
|
7895
|
+
"3F_MEDIDOR": {
|
|
7896
|
+
category: "energy",
|
|
7897
|
+
image: "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k"
|
|
7898
|
+
},
|
|
7899
|
+
RELOGIO: {
|
|
7900
|
+
category: "energy",
|
|
7901
|
+
image: "https://dashboard.myio-bas.com/api/images/public/ljHZostWg0G5AfKiyM8oZixWRIIGRASB"
|
|
7902
|
+
},
|
|
7903
|
+
ENTRADA: {
|
|
7904
|
+
category: "energy",
|
|
7905
|
+
image: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU"
|
|
7906
|
+
},
|
|
7907
|
+
SUBESTACAO: {
|
|
7908
|
+
category: "energy",
|
|
7909
|
+
image: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU"
|
|
7910
|
+
},
|
|
7911
|
+
FANCOIL: {
|
|
7912
|
+
category: "energy",
|
|
7913
|
+
image: "https://dashboard.myio-bas.com/api/images/public/4BWMuVIFHnsfqatiV86DmTrOB7IF0X8Y"
|
|
7914
|
+
},
|
|
7915
|
+
CHILLER: {
|
|
7916
|
+
category: "energy",
|
|
7917
|
+
image: "https://dashboard.myio-bas.com/api/images/public/27Rvy9HbNoPz8KKWPa0SBDwu4kQ827VU"
|
|
7918
|
+
},
|
|
7919
|
+
AR_CONDICIONADO: { category: "energy", image: null },
|
|
7920
|
+
HVAC: { category: "energy", image: null },
|
|
7921
|
+
// Water devices
|
|
7922
|
+
HIDROMETRO: {
|
|
7923
|
+
category: "water",
|
|
7924
|
+
image: "https://dashboard.myio-bas.com/api/images/public/aMQYFJbGHs9gQbQkMn6XseAlUZHanBR4"
|
|
7925
|
+
},
|
|
7926
|
+
CAIXA_DAGUA: {
|
|
7927
|
+
category: "water",
|
|
7928
|
+
image: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq"
|
|
7929
|
+
},
|
|
7930
|
+
// Tank devices (dynamic images based on level)
|
|
7931
|
+
TANK: { category: "tank", image: null },
|
|
7932
|
+
// Temperature devices (dynamic images based on status)
|
|
7933
|
+
TERMOSTATO: { category: "temperature", image: null }
|
|
7934
|
+
};
|
|
7935
|
+
var ENERGY_DEVICE_TYPES = new Set(
|
|
7936
|
+
Object.entries(DEVICE_TYPE_CONFIG).filter(([_, cfg]) => cfg.category === "energy").map(([type]) => type)
|
|
7937
|
+
);
|
|
7938
|
+
var WATER_DEVICE_TYPES = new Set(
|
|
7939
|
+
Object.entries(DEVICE_TYPE_CONFIG).filter(([_, cfg]) => cfg.category === "water").map(([type]) => type)
|
|
7940
|
+
);
|
|
7941
|
+
var TEMPERATURE_DEVICE_TYPES = new Set(
|
|
7942
|
+
Object.entries(DEVICE_TYPE_CONFIG).filter(([_, cfg]) => cfg.category === "temperature").map(([type]) => type)
|
|
7943
|
+
);
|
|
7944
|
+
var DEFAULT_DEVICE_IMAGE = "https://cdn-icons-png.flaticon.com/512/1178/1178428.png";
|
|
7945
|
+
var getDeviceCategory = (deviceType) => {
|
|
7946
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7947
|
+
return DEVICE_TYPE_CONFIG[normalizedType]?.category || "energy";
|
|
7948
|
+
};
|
|
7949
|
+
var isEnergyDeviceType = (deviceType) => {
|
|
7950
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7951
|
+
return ENERGY_DEVICE_TYPES.has(normalizedType);
|
|
7952
|
+
};
|
|
7953
|
+
var isTemperatureDeviceType = (deviceType) => {
|
|
7954
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7955
|
+
return TEMPERATURE_DEVICE_TYPES.has(normalizedType);
|
|
7956
|
+
};
|
|
7957
|
+
var getStaticDeviceImage = (deviceType) => {
|
|
7958
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7959
|
+
return DEVICE_TYPE_CONFIG[normalizedType]?.image || DEFAULT_DEVICE_IMAGE;
|
|
7960
|
+
};
|
|
7867
7961
|
function renderCardComponentV5({
|
|
7868
7962
|
entityObject,
|
|
7869
7963
|
handleActionDashboard,
|
|
@@ -7986,10 +8080,14 @@ function renderCardComponentV5({
|
|
|
7986
8080
|
};
|
|
7987
8081
|
})();
|
|
7988
8082
|
if (handInfo) {
|
|
7989
|
-
console.warn(
|
|
8083
|
+
console.warn(
|
|
8084
|
+
"[template-card-v5] handInfo parameter is deprecated. Info functionality has been moved to settings modal."
|
|
8085
|
+
);
|
|
7990
8086
|
}
|
|
7991
8087
|
if (!useNewComponents) {
|
|
7992
|
-
console.warn(
|
|
8088
|
+
console.warn(
|
|
8089
|
+
"[template-card-v5] useNewComponents=false is not recommended. Consider using template-card-v2 directly."
|
|
8090
|
+
);
|
|
7993
8091
|
}
|
|
7994
8092
|
const connectionStatus = mapDeviceToConnectionStatus(deviceStatus);
|
|
7995
8093
|
const isOffline = isDeviceOffline(deviceStatus);
|
|
@@ -7997,53 +8095,19 @@ function renderCardComponentV5({
|
|
|
7997
8095
|
const icon = getDeviceStatusIcon(deviceStatus, deviceType);
|
|
7998
8096
|
const connectionIcon = getConnectionStatusIcon(connectionStatus);
|
|
7999
8097
|
const mapDeviceTypeToIcon = (deviceType2) => {
|
|
8000
|
-
const
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
"MOTOR": "energy",
|
|
8006
|
-
"3F_MEDIDOR": "energy",
|
|
8007
|
-
"RELOGIO": "energy",
|
|
8008
|
-
"ENTRADA": "energy",
|
|
8009
|
-
"SUBESTACAO": "energy",
|
|
8010
|
-
"HIDROMETRO": "water",
|
|
8011
|
-
"CAIXA_DAGUA": "water",
|
|
8012
|
-
"TANK": "water",
|
|
8013
|
-
"TERMOSTATO": "temperature"
|
|
8014
|
-
};
|
|
8015
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
8016
|
-
return typeMap[normalizedType] || "generic";
|
|
8098
|
+
const category = getDeviceCategory(deviceType2);
|
|
8099
|
+
if (category === "water" || category === "tank") return "water";
|
|
8100
|
+
if (category === "temperature") return "temperature";
|
|
8101
|
+
if (category === "energy") return "energy";
|
|
8102
|
+
return "generic";
|
|
8017
8103
|
};
|
|
8018
8104
|
const getValueTypeFromDeviceType = (deviceType2) => {
|
|
8019
|
-
const
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
"ESCADA_ROLANTE": "ENERGY",
|
|
8023
|
-
"ELEVADOR": "ENERGY",
|
|
8024
|
-
"MOTOR": "ENERGY",
|
|
8025
|
-
"3F_MEDIDOR": "ENERGY",
|
|
8026
|
-
"RELOGIO": "ENERGY",
|
|
8027
|
-
"ENTRADA": "ENERGY",
|
|
8028
|
-
"SUBESTACAO": "ENERGY",
|
|
8029
|
-
"HIDROMETRO": "WATER",
|
|
8030
|
-
"CAIXA_DAGUA": "WATER",
|
|
8031
|
-
"TANK": "TANK",
|
|
8032
|
-
"TERMOSTATO": "TEMPERATURE"
|
|
8033
|
-
};
|
|
8034
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
8035
|
-
return typeMap[normalizedType] || "ENERGY";
|
|
8036
|
-
};
|
|
8037
|
-
const isEnergyDevice = (deviceType2) => {
|
|
8038
|
-
const energyDeviceTypes = ["COMPRESSOR", "VENTILADOR", "ESCADA_ROLANTE", "ELEVADOR", "MOTOR", "3F_MEDIDOR", "RELOGIO", "ENTRADA", "SUBESTACAO"];
|
|
8039
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
8040
|
-
return energyDeviceTypes.includes(normalizedType);
|
|
8041
|
-
};
|
|
8042
|
-
const isTemperatureDevice = (deviceType2) => {
|
|
8043
|
-
const temperatureDeviceTypes = ["TERMOSTATO"];
|
|
8044
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
8045
|
-
return temperatureDeviceTypes.includes(normalizedType);
|
|
8105
|
+
const category = getDeviceCategory(deviceType2);
|
|
8106
|
+
if (category === "tank") return "TANK";
|
|
8107
|
+
return category.toUpperCase();
|
|
8046
8108
|
};
|
|
8109
|
+
const isEnergyDevice = (deviceType2) => isEnergyDeviceType(deviceType2);
|
|
8110
|
+
const isTemperatureDevice = (deviceType2) => isTemperatureDeviceType(deviceType2);
|
|
8047
8111
|
const formatCardValue = (value, deviceType2) => {
|
|
8048
8112
|
const numValue = Number(value) || 0;
|
|
8049
8113
|
if (isEnergyDevice(deviceType2)) {
|
|
@@ -8276,13 +8340,7 @@ function renderCardComponentV5({
|
|
|
8276
8340
|
}
|
|
8277
8341
|
const getDeviceImageUrl = (deviceType2, percentage = 0, options = {}) => {
|
|
8278
8342
|
const { tempStatus: tempStatus2, isOffline: isOffline2 } = options;
|
|
8279
|
-
|
|
8280
|
-
if (typeof str !== "string") {
|
|
8281
|
-
str = "";
|
|
8282
|
-
}
|
|
8283
|
-
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toUpperCase();
|
|
8284
|
-
}
|
|
8285
|
-
const nameType = normalizeString(deviceType2);
|
|
8343
|
+
const nameType = String(deviceType2 || "").toUpperCase();
|
|
8286
8344
|
if (nameType === "TERMOSTATO") {
|
|
8287
8345
|
if (isOffline2) {
|
|
8288
8346
|
return "https://dashboard.myio-bas.com/api/images/public/Q4bE6zWz4pL3u5M3rjmMt2uSis6Xe52F";
|
|
@@ -8306,18 +8364,7 @@ function renderCardComponentV5({
|
|
|
8306
8364
|
return "https://dashboard.myio-bas.com/api/images/public/qLdwhV4qw295poSCa7HinpnmXoN7dAPO";
|
|
8307
8365
|
}
|
|
8308
8366
|
}
|
|
8309
|
-
|
|
8310
|
-
MOTOR: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
8311
|
-
"3F_MEDIDOR": "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k",
|
|
8312
|
-
RELOGIO: "https://dashboard.myio-bas.com/api/images/public/ljHZostWg0G5AfKiyM8oZixWRIIGRASB",
|
|
8313
|
-
HIDROMETRO: "https://dashboard.myio-bas.com/api/images/public/aMQYFJbGHs9gQbQkMn6XseAlUZHanBR4",
|
|
8314
|
-
ENTRADA: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU",
|
|
8315
|
-
CAIXA_DAGUA: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq",
|
|
8316
|
-
ELEVADOR: "https://dashboard.myio-bas.com/api/images/public/rAjOvdsYJLGah6w6BABPJSD9znIyrkJX",
|
|
8317
|
-
ESCADA_ROLANTE: "https://dashboard.myio-bas.com/api/images/public/EJ997iB2HD1AYYUHwIloyQOOszeqb2jp"
|
|
8318
|
-
};
|
|
8319
|
-
const defaultImage = "https://cdn-icons-png.flaticon.com/512/1178/1178428.png";
|
|
8320
|
-
return deviceImages[nameType] || defaultImage;
|
|
8367
|
+
return getStaticDeviceImage(nameType);
|
|
8321
8368
|
};
|
|
8322
8369
|
const isTankDevice = deviceType === "TANK" || deviceType === "CAIXA_DAGUA";
|
|
8323
8370
|
const isTermostatoDevice = deviceType?.toUpperCase() === "TERMOSTATO";
|
|
@@ -18350,10 +18397,10 @@ var DEVICE_TYPES = [
|
|
|
18350
18397
|
{ value: "ELEVADOR", label: "Elevador" },
|
|
18351
18398
|
{ value: "ESCADA_ROLANTE", label: "Escada Rolante" },
|
|
18352
18399
|
{ value: "MOTOR", label: "Motor" },
|
|
18353
|
-
{ value: "
|
|
18400
|
+
{ value: "BOMBA_HIDRAULICA", label: "Bomba Hidr\xE1ulica" },
|
|
18401
|
+
{ value: "BOMBA_INCENDIO", label: "Bomba Inc\xEAndio" },
|
|
18354
18402
|
{ value: "CHILLER", label: "Chiller" },
|
|
18355
18403
|
{ value: "AR_CONDICIONADO", label: "Ar Condicionado" },
|
|
18356
|
-
{ value: "HVAC", label: "HVAC" },
|
|
18357
18404
|
{ value: "FANCOIL", label: "Fancoil" },
|
|
18358
18405
|
{ value: "3F_MEDIDOR", label: "Medidor Trif\xE1sico" }
|
|
18359
18406
|
];
|
package/dist/index.d.cts
CHANGED
|
@@ -1766,17 +1766,17 @@ declare const DEVICE_TYPES: readonly [{
|
|
|
1766
1766
|
readonly value: "MOTOR";
|
|
1767
1767
|
readonly label: "Motor";
|
|
1768
1768
|
}, {
|
|
1769
|
-
readonly value: "
|
|
1770
|
-
readonly label: "Bomba";
|
|
1769
|
+
readonly value: "BOMBA_HIDRAULICA";
|
|
1770
|
+
readonly label: "Bomba Hidráulica";
|
|
1771
|
+
}, {
|
|
1772
|
+
readonly value: "BOMBA_INCENDIO";
|
|
1773
|
+
readonly label: "Bomba Incêndio";
|
|
1771
1774
|
}, {
|
|
1772
1775
|
readonly value: "CHILLER";
|
|
1773
1776
|
readonly label: "Chiller";
|
|
1774
1777
|
}, {
|
|
1775
1778
|
readonly value: "AR_CONDICIONADO";
|
|
1776
1779
|
readonly label: "Ar Condicionado";
|
|
1777
|
-
}, {
|
|
1778
|
-
readonly value: "HVAC";
|
|
1779
|
-
readonly label: "HVAC";
|
|
1780
1780
|
}, {
|
|
1781
1781
|
readonly value: "FANCOIL";
|
|
1782
1782
|
readonly label: "Fancoil";
|
package/dist/index.js
CHANGED
|
@@ -7717,6 +7717,100 @@ function renderCardComponentHeadOffice(containerEl, params) {
|
|
|
7717
7717
|
|
|
7718
7718
|
// src/thingsboard/main-dashboard-shopping/v-5.2.0/card/template-card-v5.js
|
|
7719
7719
|
var LABEL_CHAR_LIMIT2 = 18;
|
|
7720
|
+
var DEVICE_TYPE_CONFIG = {
|
|
7721
|
+
// Energy devices
|
|
7722
|
+
COMPRESSOR: { category: "energy", image: null },
|
|
7723
|
+
VENTILADOR: { category: "energy", image: null },
|
|
7724
|
+
ESCADA_ROLANTE: {
|
|
7725
|
+
category: "energy",
|
|
7726
|
+
image: "https://dashboard.myio-bas.com/api/images/public/EJ997iB2HD1AYYUHwIloyQOOszeqb2jp"
|
|
7727
|
+
},
|
|
7728
|
+
ELEVADOR: {
|
|
7729
|
+
category: "energy",
|
|
7730
|
+
image: "https://dashboard.myio-bas.com/api/images/public/rAjOvdsYJLGah6w6BABPJSD9znIyrkJX"
|
|
7731
|
+
},
|
|
7732
|
+
MOTOR: {
|
|
7733
|
+
category: "energy",
|
|
7734
|
+
image: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT"
|
|
7735
|
+
},
|
|
7736
|
+
BOMBA_HIDRAULICA: {
|
|
7737
|
+
category: "energy",
|
|
7738
|
+
image: "https://dashboard.myio-bas.com/api/images/public/rbO2wQb6iKBtX0Ec04DFDcO3Qg04EOoD"
|
|
7739
|
+
},
|
|
7740
|
+
BOMBA_INCENDIO: {
|
|
7741
|
+
category: "energy",
|
|
7742
|
+
image: "https://dashboard.myio-bas.com/api/images/public/YJkELCk9kluQSM6QXaFINX6byQWI7vbB"
|
|
7743
|
+
},
|
|
7744
|
+
BOMBA: {
|
|
7745
|
+
category: "energy",
|
|
7746
|
+
image: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT"
|
|
7747
|
+
},
|
|
7748
|
+
"3F_MEDIDOR": {
|
|
7749
|
+
category: "energy",
|
|
7750
|
+
image: "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k"
|
|
7751
|
+
},
|
|
7752
|
+
RELOGIO: {
|
|
7753
|
+
category: "energy",
|
|
7754
|
+
image: "https://dashboard.myio-bas.com/api/images/public/ljHZostWg0G5AfKiyM8oZixWRIIGRASB"
|
|
7755
|
+
},
|
|
7756
|
+
ENTRADA: {
|
|
7757
|
+
category: "energy",
|
|
7758
|
+
image: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU"
|
|
7759
|
+
},
|
|
7760
|
+
SUBESTACAO: {
|
|
7761
|
+
category: "energy",
|
|
7762
|
+
image: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU"
|
|
7763
|
+
},
|
|
7764
|
+
FANCOIL: {
|
|
7765
|
+
category: "energy",
|
|
7766
|
+
image: "https://dashboard.myio-bas.com/api/images/public/4BWMuVIFHnsfqatiV86DmTrOB7IF0X8Y"
|
|
7767
|
+
},
|
|
7768
|
+
CHILLER: {
|
|
7769
|
+
category: "energy",
|
|
7770
|
+
image: "https://dashboard.myio-bas.com/api/images/public/27Rvy9HbNoPz8KKWPa0SBDwu4kQ827VU"
|
|
7771
|
+
},
|
|
7772
|
+
AR_CONDICIONADO: { category: "energy", image: null },
|
|
7773
|
+
HVAC: { category: "energy", image: null },
|
|
7774
|
+
// Water devices
|
|
7775
|
+
HIDROMETRO: {
|
|
7776
|
+
category: "water",
|
|
7777
|
+
image: "https://dashboard.myio-bas.com/api/images/public/aMQYFJbGHs9gQbQkMn6XseAlUZHanBR4"
|
|
7778
|
+
},
|
|
7779
|
+
CAIXA_DAGUA: {
|
|
7780
|
+
category: "water",
|
|
7781
|
+
image: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq"
|
|
7782
|
+
},
|
|
7783
|
+
// Tank devices (dynamic images based on level)
|
|
7784
|
+
TANK: { category: "tank", image: null },
|
|
7785
|
+
// Temperature devices (dynamic images based on status)
|
|
7786
|
+
TERMOSTATO: { category: "temperature", image: null }
|
|
7787
|
+
};
|
|
7788
|
+
var ENERGY_DEVICE_TYPES = new Set(
|
|
7789
|
+
Object.entries(DEVICE_TYPE_CONFIG).filter(([_, cfg]) => cfg.category === "energy").map(([type]) => type)
|
|
7790
|
+
);
|
|
7791
|
+
var WATER_DEVICE_TYPES = new Set(
|
|
7792
|
+
Object.entries(DEVICE_TYPE_CONFIG).filter(([_, cfg]) => cfg.category === "water").map(([type]) => type)
|
|
7793
|
+
);
|
|
7794
|
+
var TEMPERATURE_DEVICE_TYPES = new Set(
|
|
7795
|
+
Object.entries(DEVICE_TYPE_CONFIG).filter(([_, cfg]) => cfg.category === "temperature").map(([type]) => type)
|
|
7796
|
+
);
|
|
7797
|
+
var DEFAULT_DEVICE_IMAGE = "https://cdn-icons-png.flaticon.com/512/1178/1178428.png";
|
|
7798
|
+
var getDeviceCategory = (deviceType) => {
|
|
7799
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7800
|
+
return DEVICE_TYPE_CONFIG[normalizedType]?.category || "energy";
|
|
7801
|
+
};
|
|
7802
|
+
var isEnergyDeviceType = (deviceType) => {
|
|
7803
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7804
|
+
return ENERGY_DEVICE_TYPES.has(normalizedType);
|
|
7805
|
+
};
|
|
7806
|
+
var isTemperatureDeviceType = (deviceType) => {
|
|
7807
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7808
|
+
return TEMPERATURE_DEVICE_TYPES.has(normalizedType);
|
|
7809
|
+
};
|
|
7810
|
+
var getStaticDeviceImage = (deviceType) => {
|
|
7811
|
+
const normalizedType = String(deviceType || "").toUpperCase();
|
|
7812
|
+
return DEVICE_TYPE_CONFIG[normalizedType]?.image || DEFAULT_DEVICE_IMAGE;
|
|
7813
|
+
};
|
|
7720
7814
|
function renderCardComponentV5({
|
|
7721
7815
|
entityObject,
|
|
7722
7816
|
handleActionDashboard,
|
|
@@ -7839,10 +7933,14 @@ function renderCardComponentV5({
|
|
|
7839
7933
|
};
|
|
7840
7934
|
})();
|
|
7841
7935
|
if (handInfo) {
|
|
7842
|
-
console.warn(
|
|
7936
|
+
console.warn(
|
|
7937
|
+
"[template-card-v5] handInfo parameter is deprecated. Info functionality has been moved to settings modal."
|
|
7938
|
+
);
|
|
7843
7939
|
}
|
|
7844
7940
|
if (!useNewComponents) {
|
|
7845
|
-
console.warn(
|
|
7941
|
+
console.warn(
|
|
7942
|
+
"[template-card-v5] useNewComponents=false is not recommended. Consider using template-card-v2 directly."
|
|
7943
|
+
);
|
|
7846
7944
|
}
|
|
7847
7945
|
const connectionStatus = mapDeviceToConnectionStatus(deviceStatus);
|
|
7848
7946
|
const isOffline = isDeviceOffline(deviceStatus);
|
|
@@ -7850,53 +7948,19 @@ function renderCardComponentV5({
|
|
|
7850
7948
|
const icon = getDeviceStatusIcon(deviceStatus, deviceType);
|
|
7851
7949
|
const connectionIcon = getConnectionStatusIcon(connectionStatus);
|
|
7852
7950
|
const mapDeviceTypeToIcon = (deviceType2) => {
|
|
7853
|
-
const
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
"MOTOR": "energy",
|
|
7859
|
-
"3F_MEDIDOR": "energy",
|
|
7860
|
-
"RELOGIO": "energy",
|
|
7861
|
-
"ENTRADA": "energy",
|
|
7862
|
-
"SUBESTACAO": "energy",
|
|
7863
|
-
"HIDROMETRO": "water",
|
|
7864
|
-
"CAIXA_DAGUA": "water",
|
|
7865
|
-
"TANK": "water",
|
|
7866
|
-
"TERMOSTATO": "temperature"
|
|
7867
|
-
};
|
|
7868
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
7869
|
-
return typeMap[normalizedType] || "generic";
|
|
7951
|
+
const category = getDeviceCategory(deviceType2);
|
|
7952
|
+
if (category === "water" || category === "tank") return "water";
|
|
7953
|
+
if (category === "temperature") return "temperature";
|
|
7954
|
+
if (category === "energy") return "energy";
|
|
7955
|
+
return "generic";
|
|
7870
7956
|
};
|
|
7871
7957
|
const getValueTypeFromDeviceType = (deviceType2) => {
|
|
7872
|
-
const
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
"ESCADA_ROLANTE": "ENERGY",
|
|
7876
|
-
"ELEVADOR": "ENERGY",
|
|
7877
|
-
"MOTOR": "ENERGY",
|
|
7878
|
-
"3F_MEDIDOR": "ENERGY",
|
|
7879
|
-
"RELOGIO": "ENERGY",
|
|
7880
|
-
"ENTRADA": "ENERGY",
|
|
7881
|
-
"SUBESTACAO": "ENERGY",
|
|
7882
|
-
"HIDROMETRO": "WATER",
|
|
7883
|
-
"CAIXA_DAGUA": "WATER",
|
|
7884
|
-
"TANK": "TANK",
|
|
7885
|
-
"TERMOSTATO": "TEMPERATURE"
|
|
7886
|
-
};
|
|
7887
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
7888
|
-
return typeMap[normalizedType] || "ENERGY";
|
|
7889
|
-
};
|
|
7890
|
-
const isEnergyDevice = (deviceType2) => {
|
|
7891
|
-
const energyDeviceTypes = ["COMPRESSOR", "VENTILADOR", "ESCADA_ROLANTE", "ELEVADOR", "MOTOR", "3F_MEDIDOR", "RELOGIO", "ENTRADA", "SUBESTACAO"];
|
|
7892
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
7893
|
-
return energyDeviceTypes.includes(normalizedType);
|
|
7894
|
-
};
|
|
7895
|
-
const isTemperatureDevice = (deviceType2) => {
|
|
7896
|
-
const temperatureDeviceTypes = ["TERMOSTATO"];
|
|
7897
|
-
const normalizedType = deviceType2?.toUpperCase() || "";
|
|
7898
|
-
return temperatureDeviceTypes.includes(normalizedType);
|
|
7958
|
+
const category = getDeviceCategory(deviceType2);
|
|
7959
|
+
if (category === "tank") return "TANK";
|
|
7960
|
+
return category.toUpperCase();
|
|
7899
7961
|
};
|
|
7962
|
+
const isEnergyDevice = (deviceType2) => isEnergyDeviceType(deviceType2);
|
|
7963
|
+
const isTemperatureDevice = (deviceType2) => isTemperatureDeviceType(deviceType2);
|
|
7900
7964
|
const formatCardValue = (value, deviceType2) => {
|
|
7901
7965
|
const numValue = Number(value) || 0;
|
|
7902
7966
|
if (isEnergyDevice(deviceType2)) {
|
|
@@ -8129,13 +8193,7 @@ function renderCardComponentV5({
|
|
|
8129
8193
|
}
|
|
8130
8194
|
const getDeviceImageUrl = (deviceType2, percentage = 0, options = {}) => {
|
|
8131
8195
|
const { tempStatus: tempStatus2, isOffline: isOffline2 } = options;
|
|
8132
|
-
|
|
8133
|
-
if (typeof str !== "string") {
|
|
8134
|
-
str = "";
|
|
8135
|
-
}
|
|
8136
|
-
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toUpperCase();
|
|
8137
|
-
}
|
|
8138
|
-
const nameType = normalizeString(deviceType2);
|
|
8196
|
+
const nameType = String(deviceType2 || "").toUpperCase();
|
|
8139
8197
|
if (nameType === "TERMOSTATO") {
|
|
8140
8198
|
if (isOffline2) {
|
|
8141
8199
|
return "https://dashboard.myio-bas.com/api/images/public/Q4bE6zWz4pL3u5M3rjmMt2uSis6Xe52F";
|
|
@@ -8159,18 +8217,7 @@ function renderCardComponentV5({
|
|
|
8159
8217
|
return "https://dashboard.myio-bas.com/api/images/public/qLdwhV4qw295poSCa7HinpnmXoN7dAPO";
|
|
8160
8218
|
}
|
|
8161
8219
|
}
|
|
8162
|
-
|
|
8163
|
-
MOTOR: "https://dashboard.myio-bas.com/api/images/public/Rge8Q3t0CP5PW8XyTn9bBK9aVP6uzSTT",
|
|
8164
|
-
"3F_MEDIDOR": "https://dashboard.myio-bas.com/api/images/public/f9Ce4meybsdaAhAkUlAfy5ei3I4kcN4k",
|
|
8165
|
-
RELOGIO: "https://dashboard.myio-bas.com/api/images/public/ljHZostWg0G5AfKiyM8oZixWRIIGRASB",
|
|
8166
|
-
HIDROMETRO: "https://dashboard.myio-bas.com/api/images/public/aMQYFJbGHs9gQbQkMn6XseAlUZHanBR4",
|
|
8167
|
-
ENTRADA: "https://dashboard.myio-bas.com/api/images/public/TQHPFqiejMW6lOSVsb8Pi85WtC0QKOLU",
|
|
8168
|
-
CAIXA_DAGUA: "https://dashboard.myio-bas.com/api/images/public/3t6WVhMQJFsrKA8bSZmrngDsNPkZV7fq",
|
|
8169
|
-
ELEVADOR: "https://dashboard.myio-bas.com/api/images/public/rAjOvdsYJLGah6w6BABPJSD9znIyrkJX",
|
|
8170
|
-
ESCADA_ROLANTE: "https://dashboard.myio-bas.com/api/images/public/EJ997iB2HD1AYYUHwIloyQOOszeqb2jp"
|
|
8171
|
-
};
|
|
8172
|
-
const defaultImage = "https://cdn-icons-png.flaticon.com/512/1178/1178428.png";
|
|
8173
|
-
return deviceImages[nameType] || defaultImage;
|
|
8220
|
+
return getStaticDeviceImage(nameType);
|
|
8174
8221
|
};
|
|
8175
8222
|
const isTankDevice = deviceType === "TANK" || deviceType === "CAIXA_DAGUA";
|
|
8176
8223
|
const isTermostatoDevice = deviceType?.toUpperCase() === "TERMOSTATO";
|
|
@@ -18203,10 +18250,10 @@ var DEVICE_TYPES = [
|
|
|
18203
18250
|
{ value: "ELEVADOR", label: "Elevador" },
|
|
18204
18251
|
{ value: "ESCADA_ROLANTE", label: "Escada Rolante" },
|
|
18205
18252
|
{ value: "MOTOR", label: "Motor" },
|
|
18206
|
-
{ value: "
|
|
18253
|
+
{ value: "BOMBA_HIDRAULICA", label: "Bomba Hidr\xE1ulica" },
|
|
18254
|
+
{ value: "BOMBA_INCENDIO", label: "Bomba Inc\xEAndio" },
|
|
18207
18255
|
{ value: "CHILLER", label: "Chiller" },
|
|
18208
18256
|
{ value: "AR_CONDICIONADO", label: "Ar Condicionado" },
|
|
18209
|
-
{ value: "HVAC", label: "HVAC" },
|
|
18210
18257
|
{ value: "FANCOIL", label: "Fancoil" },
|
|
18211
18258
|
{ value: "3F_MEDIDOR", label: "Medidor Trif\xE1sico" }
|
|
18212
18259
|
];
|