myio-js-library 0.1.142 → 0.1.143
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 +74 -63
- package/dist/index.js +74 -63
- package/dist/myio-js-library.umd.js +74 -63
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7536,7 +7536,10 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
7536
7536
|
if (!telemetryData || telemetryData.length === 0) continue;
|
|
7537
7537
|
const latest = telemetryData[0];
|
|
7538
7538
|
const config = TELEMETRY_CONFIG[key] || { label: key, unit: "", icon: "\u{1F4CA}", decimals: 2 };
|
|
7539
|
-
|
|
7539
|
+
let numValue = Number(latest.value) || 0;
|
|
7540
|
+
if (key === "total_current" || key === "current") {
|
|
7541
|
+
numValue = numValue / 1e3;
|
|
7542
|
+
}
|
|
7540
7543
|
const formatted = numValue.toFixed(config.decimals);
|
|
7541
7544
|
values.push({
|
|
7542
7545
|
key,
|
|
@@ -17182,13 +17185,30 @@ var DefaultSettingsPersister = class {
|
|
|
17182
17185
|
jwtToken;
|
|
17183
17186
|
tbBaseUrl;
|
|
17184
17187
|
deviceType;
|
|
17188
|
+
deviceProfile;
|
|
17185
17189
|
existingMapInstantaneousPower;
|
|
17186
17190
|
constructor(jwtToken, apiConfig) {
|
|
17187
17191
|
this.jwtToken = jwtToken;
|
|
17188
17192
|
this.tbBaseUrl = apiConfig?.tbBaseUrl || window.location.origin;
|
|
17189
17193
|
this.deviceType = apiConfig?.deviceType || "ELEVADOR";
|
|
17194
|
+
this.deviceProfile = apiConfig?.deviceProfile || null;
|
|
17190
17195
|
this.existingMapInstantaneousPower = apiConfig?.mapInstantaneousPower || null;
|
|
17191
17196
|
}
|
|
17197
|
+
/**
|
|
17198
|
+
* RFC-0086: Resolve effective device type
|
|
17199
|
+
* When deviceType is 3F_MEDIDOR, use deviceProfile as the actual type
|
|
17200
|
+
*/
|
|
17201
|
+
getEffectiveDeviceType() {
|
|
17202
|
+
const normalizedType = (this.deviceType || "").toUpperCase();
|
|
17203
|
+
if (normalizedType === "3F_MEDIDOR") {
|
|
17204
|
+
const profile = (this.deviceProfile || "").toUpperCase();
|
|
17205
|
+
if (profile && profile !== "N/D" && profile.trim() !== "") {
|
|
17206
|
+
console.log(`[SettingsPersister] RFC-0086: Resolved 3F_MEDIDOR \u2192 ${profile}`);
|
|
17207
|
+
return profile;
|
|
17208
|
+
}
|
|
17209
|
+
}
|
|
17210
|
+
return normalizedType || "ELEVADOR";
|
|
17211
|
+
}
|
|
17192
17212
|
async saveEntityLabel(deviceId, label) {
|
|
17193
17213
|
try {
|
|
17194
17214
|
const getRes = await fetch(`${this.tbBaseUrl}/api/device/${deviceId}`, {
|
|
@@ -17246,72 +17266,59 @@ var DefaultSettingsPersister = class {
|
|
|
17246
17266
|
}
|
|
17247
17267
|
}
|
|
17248
17268
|
/**
|
|
17249
|
-
* RFC-
|
|
17250
|
-
*
|
|
17269
|
+
* RFC-0086: Build mapInstantaneousPower JSON structure from form data
|
|
17270
|
+
* IMPORTANT: When saving to a DEVICE, only include entries for the specific deviceType
|
|
17271
|
+
* Uses getEffectiveDeviceType() to resolve 3F_MEDIDOR → deviceProfile
|
|
17251
17272
|
*/
|
|
17252
17273
|
buildMapInstantaneousPower(formData) {
|
|
17253
|
-
const
|
|
17254
|
-
version: "1.0.0",
|
|
17255
|
-
limitsByInstantaneoustPowerType: []
|
|
17256
|
-
};
|
|
17274
|
+
const effectiveDeviceType = this.getEffectiveDeviceType();
|
|
17257
17275
|
const telemetryType = String(formData.telemetryType || "consumption");
|
|
17258
|
-
|
|
17259
|
-
|
|
17260
|
-
|
|
17261
|
-
|
|
17262
|
-
|
|
17263
|
-
|
|
17264
|
-
|
|
17265
|
-
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
|
|
17274
|
-
|
|
17275
|
-
|
|
17276
|
-
|
|
17277
|
-
|
|
17278
|
-
|
|
17279
|
-
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17286
|
-
|
|
17287
|
-
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
topValue: Number(formData.alertLimitUpConsumption) || 0
|
|
17301
|
-
}
|
|
17302
|
-
},
|
|
17303
|
-
{
|
|
17304
|
-
deviceStatusName: "failure",
|
|
17305
|
-
limitsValues: {
|
|
17306
|
-
baseValue: Number(formData.failureLimitDownConsumption) || 0,
|
|
17307
|
-
topValue: Number(formData.failureLimitUpConsumption) || 0
|
|
17276
|
+
const result = {
|
|
17277
|
+
version: "1.0.0",
|
|
17278
|
+
limitsByInstantaneoustPowerType: [
|
|
17279
|
+
{
|
|
17280
|
+
telemetryType,
|
|
17281
|
+
itemsByDeviceType: [
|
|
17282
|
+
{
|
|
17283
|
+
deviceType: effectiveDeviceType,
|
|
17284
|
+
name: `mapInstantaneousPower${this.formatDeviceTypeName(effectiveDeviceType)}`,
|
|
17285
|
+
description: formData.identifier ? `Limites customizados para ${formData.identifier}` : `Limites de pot\xEAncia customizados para ${effectiveDeviceType}`,
|
|
17286
|
+
limitsByDeviceStatus: [
|
|
17287
|
+
{
|
|
17288
|
+
deviceStatusName: "standBy",
|
|
17289
|
+
limitsValues: {
|
|
17290
|
+
baseValue: Number(formData.standbyLimitDownConsumption) || 0,
|
|
17291
|
+
topValue: Number(formData.standbyLimitUpConsumption) || 0
|
|
17292
|
+
}
|
|
17293
|
+
},
|
|
17294
|
+
{
|
|
17295
|
+
deviceStatusName: "normal",
|
|
17296
|
+
limitsValues: {
|
|
17297
|
+
baseValue: Number(formData.normalLimitDownConsumption) || 0,
|
|
17298
|
+
topValue: Number(formData.normalLimitUpConsumption) || 0
|
|
17299
|
+
}
|
|
17300
|
+
},
|
|
17301
|
+
{
|
|
17302
|
+
deviceStatusName: "alert",
|
|
17303
|
+
limitsValues: {
|
|
17304
|
+
baseValue: Number(formData.alertLimitDownConsumption) || 0,
|
|
17305
|
+
topValue: Number(formData.alertLimitUpConsumption) || 0
|
|
17306
|
+
}
|
|
17307
|
+
},
|
|
17308
|
+
{
|
|
17309
|
+
deviceStatusName: "failure",
|
|
17310
|
+
limitsValues: {
|
|
17311
|
+
baseValue: Number(formData.failureLimitDownConsumption) || 0,
|
|
17312
|
+
topValue: Number(formData.failureLimitUpConsumption) || 0
|
|
17313
|
+
}
|
|
17314
|
+
}
|
|
17315
|
+
]
|
|
17316
|
+
}
|
|
17317
|
+
]
|
|
17308
17318
|
}
|
|
17309
|
-
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
deviceConfig.description = `Limites customizados para ${formData.identifier}`;
|
|
17313
|
-
}
|
|
17314
|
-
console.log("[SettingsPersister] RFC-0080: Built mapInstantaneousPower:", result);
|
|
17319
|
+
]
|
|
17320
|
+
};
|
|
17321
|
+
console.log(`[SettingsPersister] RFC-0086: Built mapInstantaneousPower for deviceType=${effectiveDeviceType}:`, result);
|
|
17315
17322
|
return result;
|
|
17316
17323
|
}
|
|
17317
17324
|
/**
|
|
@@ -17550,6 +17557,8 @@ var SettingsController = class {
|
|
|
17550
17557
|
const apiConfigWithDeviceInfo = {
|
|
17551
17558
|
...params.api,
|
|
17552
17559
|
deviceType: params.deviceType,
|
|
17560
|
+
deviceProfile: params.deviceProfile,
|
|
17561
|
+
// RFC-0086: For 3F_MEDIDOR → deviceProfile resolution
|
|
17553
17562
|
mapInstantaneousPower: params.mapInstantaneousPower
|
|
17554
17563
|
};
|
|
17555
17564
|
this.persister = params.persister || new DefaultSettingsPersister(params.jwtToken, apiConfigWithDeviceInfo);
|
|
@@ -17601,6 +17610,8 @@ var SettingsController = class {
|
|
|
17601
17610
|
this.persister = new DefaultSettingsPersister(this.params.jwtToken, {
|
|
17602
17611
|
...this.params.api,
|
|
17603
17612
|
deviceType: this.params.deviceType,
|
|
17613
|
+
deviceProfile: this.params.deviceProfile,
|
|
17614
|
+
// RFC-0086: For 3F_MEDIDOR → deviceProfile resolution
|
|
17604
17615
|
mapInstantaneousPower: globalMap
|
|
17605
17616
|
});
|
|
17606
17617
|
this.view.updateMapInstantaneousPower(globalMap);
|
package/dist/index.js
CHANGED
|
@@ -7428,7 +7428,10 @@ async function openRealTimeTelemetryModal(params) {
|
|
|
7428
7428
|
if (!telemetryData || telemetryData.length === 0) continue;
|
|
7429
7429
|
const latest = telemetryData[0];
|
|
7430
7430
|
const config = TELEMETRY_CONFIG[key] || { label: key, unit: "", icon: "\u{1F4CA}", decimals: 2 };
|
|
7431
|
-
|
|
7431
|
+
let numValue = Number(latest.value) || 0;
|
|
7432
|
+
if (key === "total_current" || key === "current") {
|
|
7433
|
+
numValue = numValue / 1e3;
|
|
7434
|
+
}
|
|
7432
7435
|
const formatted = numValue.toFixed(config.decimals);
|
|
7433
7436
|
values.push({
|
|
7434
7437
|
key,
|
|
@@ -17074,13 +17077,30 @@ var DefaultSettingsPersister = class {
|
|
|
17074
17077
|
jwtToken;
|
|
17075
17078
|
tbBaseUrl;
|
|
17076
17079
|
deviceType;
|
|
17080
|
+
deviceProfile;
|
|
17077
17081
|
existingMapInstantaneousPower;
|
|
17078
17082
|
constructor(jwtToken, apiConfig) {
|
|
17079
17083
|
this.jwtToken = jwtToken;
|
|
17080
17084
|
this.tbBaseUrl = apiConfig?.tbBaseUrl || window.location.origin;
|
|
17081
17085
|
this.deviceType = apiConfig?.deviceType || "ELEVADOR";
|
|
17086
|
+
this.deviceProfile = apiConfig?.deviceProfile || null;
|
|
17082
17087
|
this.existingMapInstantaneousPower = apiConfig?.mapInstantaneousPower || null;
|
|
17083
17088
|
}
|
|
17089
|
+
/**
|
|
17090
|
+
* RFC-0086: Resolve effective device type
|
|
17091
|
+
* When deviceType is 3F_MEDIDOR, use deviceProfile as the actual type
|
|
17092
|
+
*/
|
|
17093
|
+
getEffectiveDeviceType() {
|
|
17094
|
+
const normalizedType = (this.deviceType || "").toUpperCase();
|
|
17095
|
+
if (normalizedType === "3F_MEDIDOR") {
|
|
17096
|
+
const profile = (this.deviceProfile || "").toUpperCase();
|
|
17097
|
+
if (profile && profile !== "N/D" && profile.trim() !== "") {
|
|
17098
|
+
console.log(`[SettingsPersister] RFC-0086: Resolved 3F_MEDIDOR \u2192 ${profile}`);
|
|
17099
|
+
return profile;
|
|
17100
|
+
}
|
|
17101
|
+
}
|
|
17102
|
+
return normalizedType || "ELEVADOR";
|
|
17103
|
+
}
|
|
17084
17104
|
async saveEntityLabel(deviceId, label) {
|
|
17085
17105
|
try {
|
|
17086
17106
|
const getRes = await fetch(`${this.tbBaseUrl}/api/device/${deviceId}`, {
|
|
@@ -17138,72 +17158,59 @@ var DefaultSettingsPersister = class {
|
|
|
17138
17158
|
}
|
|
17139
17159
|
}
|
|
17140
17160
|
/**
|
|
17141
|
-
* RFC-
|
|
17142
|
-
*
|
|
17161
|
+
* RFC-0086: Build mapInstantaneousPower JSON structure from form data
|
|
17162
|
+
* IMPORTANT: When saving to a DEVICE, only include entries for the specific deviceType
|
|
17163
|
+
* Uses getEffectiveDeviceType() to resolve 3F_MEDIDOR → deviceProfile
|
|
17143
17164
|
*/
|
|
17144
17165
|
buildMapInstantaneousPower(formData) {
|
|
17145
|
-
const
|
|
17146
|
-
version: "1.0.0",
|
|
17147
|
-
limitsByInstantaneoustPowerType: []
|
|
17148
|
-
};
|
|
17166
|
+
const effectiveDeviceType = this.getEffectiveDeviceType();
|
|
17149
17167
|
const telemetryType = String(formData.telemetryType || "consumption");
|
|
17150
|
-
|
|
17151
|
-
|
|
17152
|
-
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
|
|
17163
|
-
|
|
17164
|
-
|
|
17165
|
-
|
|
17166
|
-
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
|
|
17183
|
-
|
|
17184
|
-
|
|
17185
|
-
|
|
17186
|
-
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17190
|
-
|
|
17191
|
-
|
|
17192
|
-
topValue: Number(formData.alertLimitUpConsumption) || 0
|
|
17193
|
-
}
|
|
17194
|
-
},
|
|
17195
|
-
{
|
|
17196
|
-
deviceStatusName: "failure",
|
|
17197
|
-
limitsValues: {
|
|
17198
|
-
baseValue: Number(formData.failureLimitDownConsumption) || 0,
|
|
17199
|
-
topValue: Number(formData.failureLimitUpConsumption) || 0
|
|
17168
|
+
const result = {
|
|
17169
|
+
version: "1.0.0",
|
|
17170
|
+
limitsByInstantaneoustPowerType: [
|
|
17171
|
+
{
|
|
17172
|
+
telemetryType,
|
|
17173
|
+
itemsByDeviceType: [
|
|
17174
|
+
{
|
|
17175
|
+
deviceType: effectiveDeviceType,
|
|
17176
|
+
name: `mapInstantaneousPower${this.formatDeviceTypeName(effectiveDeviceType)}`,
|
|
17177
|
+
description: formData.identifier ? `Limites customizados para ${formData.identifier}` : `Limites de pot\xEAncia customizados para ${effectiveDeviceType}`,
|
|
17178
|
+
limitsByDeviceStatus: [
|
|
17179
|
+
{
|
|
17180
|
+
deviceStatusName: "standBy",
|
|
17181
|
+
limitsValues: {
|
|
17182
|
+
baseValue: Number(formData.standbyLimitDownConsumption) || 0,
|
|
17183
|
+
topValue: Number(formData.standbyLimitUpConsumption) || 0
|
|
17184
|
+
}
|
|
17185
|
+
},
|
|
17186
|
+
{
|
|
17187
|
+
deviceStatusName: "normal",
|
|
17188
|
+
limitsValues: {
|
|
17189
|
+
baseValue: Number(formData.normalLimitDownConsumption) || 0,
|
|
17190
|
+
topValue: Number(formData.normalLimitUpConsumption) || 0
|
|
17191
|
+
}
|
|
17192
|
+
},
|
|
17193
|
+
{
|
|
17194
|
+
deviceStatusName: "alert",
|
|
17195
|
+
limitsValues: {
|
|
17196
|
+
baseValue: Number(formData.alertLimitDownConsumption) || 0,
|
|
17197
|
+
topValue: Number(formData.alertLimitUpConsumption) || 0
|
|
17198
|
+
}
|
|
17199
|
+
},
|
|
17200
|
+
{
|
|
17201
|
+
deviceStatusName: "failure",
|
|
17202
|
+
limitsValues: {
|
|
17203
|
+
baseValue: Number(formData.failureLimitDownConsumption) || 0,
|
|
17204
|
+
topValue: Number(formData.failureLimitUpConsumption) || 0
|
|
17205
|
+
}
|
|
17206
|
+
}
|
|
17207
|
+
]
|
|
17208
|
+
}
|
|
17209
|
+
]
|
|
17200
17210
|
}
|
|
17201
|
-
|
|
17202
|
-
|
|
17203
|
-
|
|
17204
|
-
deviceConfig.description = `Limites customizados para ${formData.identifier}`;
|
|
17205
|
-
}
|
|
17206
|
-
console.log("[SettingsPersister] RFC-0080: Built mapInstantaneousPower:", result);
|
|
17211
|
+
]
|
|
17212
|
+
};
|
|
17213
|
+
console.log(`[SettingsPersister] RFC-0086: Built mapInstantaneousPower for deviceType=${effectiveDeviceType}:`, result);
|
|
17207
17214
|
return result;
|
|
17208
17215
|
}
|
|
17209
17216
|
/**
|
|
@@ -17442,6 +17449,8 @@ var SettingsController = class {
|
|
|
17442
17449
|
const apiConfigWithDeviceInfo = {
|
|
17443
17450
|
...params.api,
|
|
17444
17451
|
deviceType: params.deviceType,
|
|
17452
|
+
deviceProfile: params.deviceProfile,
|
|
17453
|
+
// RFC-0086: For 3F_MEDIDOR → deviceProfile resolution
|
|
17445
17454
|
mapInstantaneousPower: params.mapInstantaneousPower
|
|
17446
17455
|
};
|
|
17447
17456
|
this.persister = params.persister || new DefaultSettingsPersister(params.jwtToken, apiConfigWithDeviceInfo);
|
|
@@ -17493,6 +17502,8 @@ var SettingsController = class {
|
|
|
17493
17502
|
this.persister = new DefaultSettingsPersister(this.params.jwtToken, {
|
|
17494
17503
|
...this.params.api,
|
|
17495
17504
|
deviceType: this.params.deviceType,
|
|
17505
|
+
deviceProfile: this.params.deviceProfile,
|
|
17506
|
+
// RFC-0086: For 3F_MEDIDOR → deviceProfile resolution
|
|
17496
17507
|
mapInstantaneousPower: globalMap
|
|
17497
17508
|
});
|
|
17498
17509
|
this.view.updateMapInstantaneousPower(globalMap);
|
|
@@ -7426,7 +7426,10 @@ ${rangeText}`;
|
|
|
7426
7426
|
if (!telemetryData || telemetryData.length === 0) continue;
|
|
7427
7427
|
const latest = telemetryData[0];
|
|
7428
7428
|
const config = TELEMETRY_CONFIG[key] || { label: key, unit: "", icon: "\u{1F4CA}", decimals: 2 };
|
|
7429
|
-
|
|
7429
|
+
let numValue = Number(latest.value) || 0;
|
|
7430
|
+
if (key === "total_current" || key === "current") {
|
|
7431
|
+
numValue = numValue / 1e3;
|
|
7432
|
+
}
|
|
7430
7433
|
const formatted = numValue.toFixed(config.decimals);
|
|
7431
7434
|
values.push({
|
|
7432
7435
|
key,
|
|
@@ -16898,13 +16901,30 @@ ${rangeText}`;
|
|
|
16898
16901
|
jwtToken;
|
|
16899
16902
|
tbBaseUrl;
|
|
16900
16903
|
deviceType;
|
|
16904
|
+
deviceProfile;
|
|
16901
16905
|
existingMapInstantaneousPower;
|
|
16902
16906
|
constructor(jwtToken, apiConfig) {
|
|
16903
16907
|
this.jwtToken = jwtToken;
|
|
16904
16908
|
this.tbBaseUrl = apiConfig?.tbBaseUrl || window.location.origin;
|
|
16905
16909
|
this.deviceType = apiConfig?.deviceType || "ELEVADOR";
|
|
16910
|
+
this.deviceProfile = apiConfig?.deviceProfile || null;
|
|
16906
16911
|
this.existingMapInstantaneousPower = apiConfig?.mapInstantaneousPower || null;
|
|
16907
16912
|
}
|
|
16913
|
+
/**
|
|
16914
|
+
* RFC-0086: Resolve effective device type
|
|
16915
|
+
* When deviceType is 3F_MEDIDOR, use deviceProfile as the actual type
|
|
16916
|
+
*/
|
|
16917
|
+
getEffectiveDeviceType() {
|
|
16918
|
+
const normalizedType = (this.deviceType || "").toUpperCase();
|
|
16919
|
+
if (normalizedType === "3F_MEDIDOR") {
|
|
16920
|
+
const profile = (this.deviceProfile || "").toUpperCase();
|
|
16921
|
+
if (profile && profile !== "N/D" && profile.trim() !== "") {
|
|
16922
|
+
console.log(`[SettingsPersister] RFC-0086: Resolved 3F_MEDIDOR \u2192 ${profile}`);
|
|
16923
|
+
return profile;
|
|
16924
|
+
}
|
|
16925
|
+
}
|
|
16926
|
+
return normalizedType || "ELEVADOR";
|
|
16927
|
+
}
|
|
16908
16928
|
async saveEntityLabel(deviceId, label) {
|
|
16909
16929
|
try {
|
|
16910
16930
|
const getRes = await fetch(`${this.tbBaseUrl}/api/device/${deviceId}`, {
|
|
@@ -16962,72 +16982,59 @@ ${rangeText}`;
|
|
|
16962
16982
|
}
|
|
16963
16983
|
}
|
|
16964
16984
|
/**
|
|
16965
|
-
* RFC-
|
|
16966
|
-
*
|
|
16985
|
+
* RFC-0086: Build mapInstantaneousPower JSON structure from form data
|
|
16986
|
+
* IMPORTANT: When saving to a DEVICE, only include entries for the specific deviceType
|
|
16987
|
+
* Uses getEffectiveDeviceType() to resolve 3F_MEDIDOR → deviceProfile
|
|
16967
16988
|
*/
|
|
16968
16989
|
buildMapInstantaneousPower(formData) {
|
|
16969
|
-
const
|
|
16970
|
-
version: "1.0.0",
|
|
16971
|
-
limitsByInstantaneoustPowerType: []
|
|
16972
|
-
};
|
|
16990
|
+
const effectiveDeviceType = this.getEffectiveDeviceType();
|
|
16973
16991
|
const telemetryType = String(formData.telemetryType || "consumption");
|
|
16974
|
-
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
topValue: Number(formData.alertLimitUpConsumption) || 0
|
|
17017
|
-
}
|
|
17018
|
-
},
|
|
17019
|
-
{
|
|
17020
|
-
deviceStatusName: "failure",
|
|
17021
|
-
limitsValues: {
|
|
17022
|
-
baseValue: Number(formData.failureLimitDownConsumption) || 0,
|
|
17023
|
-
topValue: Number(formData.failureLimitUpConsumption) || 0
|
|
16992
|
+
const result = {
|
|
16993
|
+
version: "1.0.0",
|
|
16994
|
+
limitsByInstantaneoustPowerType: [
|
|
16995
|
+
{
|
|
16996
|
+
telemetryType,
|
|
16997
|
+
itemsByDeviceType: [
|
|
16998
|
+
{
|
|
16999
|
+
deviceType: effectiveDeviceType,
|
|
17000
|
+
name: `mapInstantaneousPower${this.formatDeviceTypeName(effectiveDeviceType)}`,
|
|
17001
|
+
description: formData.identifier ? `Limites customizados para ${formData.identifier}` : `Limites de pot\xEAncia customizados para ${effectiveDeviceType}`,
|
|
17002
|
+
limitsByDeviceStatus: [
|
|
17003
|
+
{
|
|
17004
|
+
deviceStatusName: "standBy",
|
|
17005
|
+
limitsValues: {
|
|
17006
|
+
baseValue: Number(formData.standbyLimitDownConsumption) || 0,
|
|
17007
|
+
topValue: Number(formData.standbyLimitUpConsumption) || 0
|
|
17008
|
+
}
|
|
17009
|
+
},
|
|
17010
|
+
{
|
|
17011
|
+
deviceStatusName: "normal",
|
|
17012
|
+
limitsValues: {
|
|
17013
|
+
baseValue: Number(formData.normalLimitDownConsumption) || 0,
|
|
17014
|
+
topValue: Number(formData.normalLimitUpConsumption) || 0
|
|
17015
|
+
}
|
|
17016
|
+
},
|
|
17017
|
+
{
|
|
17018
|
+
deviceStatusName: "alert",
|
|
17019
|
+
limitsValues: {
|
|
17020
|
+
baseValue: Number(formData.alertLimitDownConsumption) || 0,
|
|
17021
|
+
topValue: Number(formData.alertLimitUpConsumption) || 0
|
|
17022
|
+
}
|
|
17023
|
+
},
|
|
17024
|
+
{
|
|
17025
|
+
deviceStatusName: "failure",
|
|
17026
|
+
limitsValues: {
|
|
17027
|
+
baseValue: Number(formData.failureLimitDownConsumption) || 0,
|
|
17028
|
+
topValue: Number(formData.failureLimitUpConsumption) || 0
|
|
17029
|
+
}
|
|
17030
|
+
}
|
|
17031
|
+
]
|
|
17032
|
+
}
|
|
17033
|
+
]
|
|
17024
17034
|
}
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
deviceConfig.description = `Limites customizados para ${formData.identifier}`;
|
|
17029
|
-
}
|
|
17030
|
-
console.log("[SettingsPersister] RFC-0080: Built mapInstantaneousPower:", result);
|
|
17035
|
+
]
|
|
17036
|
+
};
|
|
17037
|
+
console.log(`[SettingsPersister] RFC-0086: Built mapInstantaneousPower for deviceType=${effectiveDeviceType}:`, result);
|
|
17031
17038
|
return result;
|
|
17032
17039
|
}
|
|
17033
17040
|
/**
|
|
@@ -17266,6 +17273,8 @@ ${rangeText}`;
|
|
|
17266
17273
|
const apiConfigWithDeviceInfo = {
|
|
17267
17274
|
...params.api,
|
|
17268
17275
|
deviceType: params.deviceType,
|
|
17276
|
+
deviceProfile: params.deviceProfile,
|
|
17277
|
+
// RFC-0086: For 3F_MEDIDOR → deviceProfile resolution
|
|
17269
17278
|
mapInstantaneousPower: params.mapInstantaneousPower
|
|
17270
17279
|
};
|
|
17271
17280
|
this.persister = params.persister || new DefaultSettingsPersister(params.jwtToken, apiConfigWithDeviceInfo);
|
|
@@ -17317,6 +17326,8 @@ ${rangeText}`;
|
|
|
17317
17326
|
this.persister = new DefaultSettingsPersister(this.params.jwtToken, {
|
|
17318
17327
|
...this.params.api,
|
|
17319
17328
|
deviceType: this.params.deviceType,
|
|
17329
|
+
deviceProfile: this.params.deviceProfile,
|
|
17330
|
+
// RFC-0086: For 3F_MEDIDOR → deviceProfile resolution
|
|
17320
17331
|
mapInstantaneousPower: globalMap
|
|
17321
17332
|
});
|
|
17322
17333
|
this.view.updateMapInstantaneousPower(globalMap);
|