mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-23 14:53:07 +05:00
fix: correct threshold names across firmware and portal
Use threshold_time for the emergency-mode delay in settings, JSON, portal forms and all five translations. Convert legacy tresholdTime backup fields to threshold_time. Correct the NTC voltage threshold macro names while keeping their limits.
This commit is contained in:
1 parent
d6e1ccb22b
commit
eb5f6c9b46
13 files changed
+20
-21
No files matched your search
+1
-1
@@ -106,7 +106,7 @@ struct MqttSettings {
|
|||||||
|
|
||||||
struct EmergencySettings {
|
struct EmergencySettings {
|
||||||
float target = DEFAULT_HEATING_TARGET_TEMP;
|
float target = DEFAULT_HEATING_TARGET_TEMP;
|
||||||
unsigned short tresholdTime = 120;
|
unsigned short thresholdTime = 120;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HeatingSettings {
|
struct HeatingSettings {
|
||||||
|
|||||||
+2
-2
@@ -28,8 +28,8 @@
|
|||||||
#define DEFAULT_NTC_REF_RESISTANCE 10000.0f
|
#define DEFAULT_NTC_REF_RESISTANCE 10000.0f
|
||||||
#define DEFAULT_NTC_BETA_FACTOR 3950.0f
|
#define DEFAULT_NTC_BETA_FACTOR 3950.0f
|
||||||
#define DEFAULT_NTC_VREF 3300.0f
|
#define DEFAULT_NTC_VREF 3300.0f
|
||||||
#define DEFAULT_NTC_VLOW_TRESHOLD 25.0f
|
#define DEFAULT_NTC_VLOW_THRESHOLD 25.0f
|
||||||
#define DEFAULT_NTC_VHIGH_TRESHOLD 3298.0f
|
#define DEFAULT_NTC_VHIGH_THRESHOLD 3298.0f
|
||||||
|
|
||||||
#ifndef BUILD_VERSION
|
#ifndef BUILD_VERSION
|
||||||
#define BUILD_VERSION "0.0.0"
|
#define BUILD_VERSION "0.0.0"
|
||||||
|
|||||||
@@ -206,7 +206,6 @@ inline const char S_THRESHOLD_LOW[] = "threshold_low";
|
|||||||
inline const char S_THRESHOLD_TIME[] = "threshold_time";
|
inline const char S_THRESHOLD_TIME[] = "threshold_time";
|
||||||
inline const char S_TIMEZONE[] = "timezone";
|
inline const char S_TIMEZONE[] = "timezone";
|
||||||
inline const char S_TOTAL[] = "total";
|
inline const char S_TOTAL[] = "total";
|
||||||
inline const char S_TRESHOLD_TIME[] = "treshold_time";
|
|
||||||
inline const char S_TRUE[] = "true";
|
inline const char S_TRUE[] = "true";
|
||||||
inline const char S_TURBO[] = "turbo";
|
inline const char S_TURBO[] = "turbo";
|
||||||
inline const char S_TURBO_FACTOR[] = "turbo_factor";
|
inline const char S_TURBO_FACTOR[] = "turbo_factor";
|
||||||
|
|||||||
+5
-5
@@ -1266,7 +1266,7 @@ static SettingResult applySetting(EmergencySettings& dst, std::string_view path,
|
|||||||
JsonVariant toJson(const EmergencySettings& src, JsonVariant dst) {
|
JsonVariant toJson(const EmergencySettings& src, JsonVariant dst) {
|
||||||
auto emergency = dst.to<JsonObject>();
|
auto emergency = dst.to<JsonObject>();
|
||||||
emergency[S_TARGET] = roundf(convertTemp(src.target, UnitSystem::METRIC, settings.system.unitSystem), 2);
|
emergency[S_TARGET] = roundf(convertTemp(src.target, UnitSystem::METRIC, settings.system.unitSystem), 2);
|
||||||
emergency[S_TRESHOLD_TIME] = src.tresholdTime;
|
emergency[S_THRESHOLD_TIME] = src.thresholdTime;
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
@@ -1274,13 +1274,13 @@ JsonVariant toJson(const EmergencySettings& src, JsonVariant dst) {
|
|||||||
SettingResult fromJson(JsonVariantConst src, EmergencySettings& dst) {
|
SettingResult fromJson(JsonVariantConst src, EmergencySettings& dst) {
|
||||||
SettingResult result;
|
SettingResult result;
|
||||||
|
|
||||||
if (src[S_TRESHOLD_TIME].is<unsigned short>()) {
|
if (src[S_THRESHOLD_TIME].is<unsigned short>()) {
|
||||||
const auto value = src[S_TRESHOLD_TIME].as<unsigned short>();
|
const auto value = src[S_THRESHOLD_TIME].as<unsigned short>();
|
||||||
|
|
||||||
if (value >= 60 && value <= 1800) {
|
if (value >= 60 && value <= 1800) {
|
||||||
result.accepted = true;
|
result.accepted = true;
|
||||||
if (value != dst.tresholdTime) {
|
if (value != dst.thresholdTime) {
|
||||||
dst.tresholdTime = value;
|
dst.thresholdTime = value;
|
||||||
result.changed = true;
|
result.changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -113,7 +113,7 @@ static Task emergencyTask("Emergency mode", [](void*) {
|
|||||||
|
|
||||||
} else if (emergencyDetected && !vars.emergency.state) {
|
} else if (emergencyDetected && !vars.emergency.state) {
|
||||||
// enable emergency
|
// enable emergency
|
||||||
if (millis() - emergencyFlipTime > (settings.emergency.tresholdTime * 1000)) {
|
if (millis() - emergencyFlipTime > (settings.emergency.thresholdTime * 1000)) {
|
||||||
vars.emergency.state = true;
|
vars.emergency.state = true;
|
||||||
ESP_LOGI(L_MAIN, "Emergency mode enabled (%hhu)", emergencyFlags);
|
ESP_LOGI(L_MAIN, "Emergency mode enabled (%hhu)", emergencyFlags);
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ static Task emergencyTask("Emergency mode", [](void*) {
|
|||||||
|
|
||||||
} else if (!emergencyDetected && vars.emergency.state) {
|
} else if (!emergencyDetected && vars.emergency.state) {
|
||||||
// disable emergency
|
// disable emergency
|
||||||
if (millis() - emergencyFlipTime > (settings.emergency.tresholdTime * 1000)) {
|
if (millis() - emergencyFlipTime > (settings.emergency.thresholdTime * 1000)) {
|
||||||
vars.emergency.state = false;
|
vars.emergency.state = false;
|
||||||
ESP_LOGI(L_MAIN, "Emergency mode disabled");
|
ESP_LOGI(L_MAIN, "Emergency mode disabled");
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -893,7 +893,7 @@ static Task readNtcSensorsTask("Read NTC sensors", [](void*) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto value = analogReadMilliVolts(sSensor->gpio);
|
const auto value = analogReadMilliVolts(sSensor->gpio);
|
||||||
if (value < DEFAULT_NTC_VLOW_TRESHOLD || value > DEFAULT_NTC_VHIGH_TRESHOLD) {
|
if (value < DEFAULT_NTC_VLOW_THRESHOLD || value > DEFAULT_NTC_VHIGH_THRESHOLD) {
|
||||||
Sensors::setConnectionStatusById(sensorId, false, false);
|
Sensors::setConnectionStatusById(sensorId, false, false);
|
||||||
|
|
||||||
ESP_LOGW(
|
ESP_LOGW(
|
||||||
|
|||||||
@@ -370,7 +370,7 @@
|
|||||||
"title": "目标温度",
|
"title": "目标温度",
|
||||||
"note": "<b>重要提示:</b> 若启用OpenTherm选项 <i>«原生供暖控制»</i>,此处设定值为<u>目标室内温度</u>;<br />其他所有情况下,此处设定值为 <u>目标热媒出水温度</u>."
|
"note": "<b>重要提示:</b> 若启用OpenTherm选项 <i>«原生供暖控制»</i>,此处设定值为<u>目标室内温度</u>;<br />其他所有情况下,此处设定值为 <u>目标热媒出水温度</u>."
|
||||||
},
|
},
|
||||||
"treshold": "阈值时间 <small>(秒)</small>"
|
"thresholdTime": "进入或退出应急模式的延时 <small>(秒)</small>"
|
||||||
},
|
},
|
||||||
"equitherm": {
|
"equitherm": {
|
||||||
"slope": {
|
"slope": {
|
||||||
|
|||||||
@@ -370,7 +370,7 @@
|
|||||||
"title": "Target temperature",
|
"title": "Target temperature",
|
||||||
"note": "<b>Important:</b> <u>Target indoor temperature</u> if OT option <i>«Native heating control»</i> is enabled.<br />In all other cases, the <u>target heat carrier temperature</u>."
|
"note": "<b>Important:</b> <u>Target indoor temperature</u> if OT option <i>«Native heating control»</i> is enabled.<br />In all other cases, the <u>target heat carrier temperature</u>."
|
||||||
},
|
},
|
||||||
"treshold": "Treshold time <small>(sec)</small>"
|
"thresholdTime": "Delay before entering or leaving emergency mode <small>(sec)</small>"
|
||||||
},
|
},
|
||||||
"equitherm": {
|
"equitherm": {
|
||||||
"slope": {
|
"slope": {
|
||||||
|
|||||||
@@ -370,7 +370,7 @@
|
|||||||
"title": "Temperatura impostata",
|
"title": "Temperatura impostata",
|
||||||
"note": "<b>Importante:</b> <u>Temperatura interna impostata</u> se l'opzione OT <i>«Controllo riscaldamento interno»</i> è attivato.<br />In tutti gli altri casi, la <u>target heat carrier temperature</u>."
|
"note": "<b>Importante:</b> <u>Temperatura interna impostata</u> se l'opzione OT <i>«Controllo riscaldamento interno»</i> è attivato.<br />In tutti gli altri casi, la <u>target heat carrier temperature</u>."
|
||||||
},
|
},
|
||||||
"treshold": "Tempo di soglia <small>(sec)</small>"
|
"thresholdTime": "Ritardo di entrata e uscita dalla modalità di emergenza <small>(sec)</small>"
|
||||||
},
|
},
|
||||||
"equitherm": {
|
"equitherm": {
|
||||||
"slope": {
|
"slope": {
|
||||||
|
|||||||
@@ -370,7 +370,7 @@
|
|||||||
"title": "Doeltemperatuur",
|
"title": "Doeltemperatuur",
|
||||||
"note": "<b>Belangrijk:</b> <u>Doel binnentemperatuur</u> als OT-optie <i>«Natuurlijke verwarmingsregeling»</i> is ingeschakeld.<br />In alle andere gevallen, de <u>doel warmtedragertemperatuur</u>."
|
"note": "<b>Belangrijk:</b> <u>Doel binnentemperatuur</u> als OT-optie <i>«Natuurlijke verwarmingsregeling»</i> is ingeschakeld.<br />In alle andere gevallen, de <u>doel warmtedragertemperatuur</u>."
|
||||||
},
|
},
|
||||||
"treshold": "Drempeltijd <small>(sec)</small>"
|
"thresholdTime": "Vertraging bij in- en uitschakelen van de noodmodus <small>(sec)</small>"
|
||||||
},
|
},
|
||||||
"equitherm": {
|
"equitherm": {
|
||||||
"slope": {
|
"slope": {
|
||||||
|
|||||||
@@ -370,7 +370,7 @@
|
|||||||
"title": "Целевая температура",
|
"title": "Целевая температура",
|
||||||
"note": "<b>Важно:</b> <u>Целевая температура в помещении</u>, если включена ОТ опция <i>«Передать управление отоплением котлу»</i>.<br />Во всех остальных случаях <u>целевая температура теплоносителя</u>."
|
"note": "<b>Важно:</b> <u>Целевая температура в помещении</u>, если включена ОТ опция <i>«Передать управление отоплением котлу»</i>.<br />Во всех остальных случаях <u>целевая температура теплоносителя</u>."
|
||||||
},
|
},
|
||||||
"treshold": "Пороговое время включения <small>(сек)</small>"
|
"thresholdTime": "Задержка входа в аварийный режим и выхода из него <small>(сек)</small>"
|
||||||
},
|
},
|
||||||
"equitherm": {
|
"equitherm": {
|
||||||
"slope": {
|
"slope": {
|
||||||
|
|||||||
@@ -366,8 +366,8 @@
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<span data-i18n>settings.emergency.treshold</span>
|
<span data-i18n>settings.emergency.thresholdTime</span>
|
||||||
<input type="number" inputmode="numeric" name="treshold_time" min="60" max="1800" step="1" required>
|
<input type="number" inputmode="numeric" name="threshold_time" min="60" max="1800" step="1" required>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -1302,7 +1302,7 @@
|
|||||||
"max": data.heating.max_temp,
|
"max": data.heating.max_temp,
|
||||||
}, form);
|
}, form);
|
||||||
}
|
}
|
||||||
setInputValue("[name='treshold_time']", data.emergency.treshold_time, {}, form);
|
setInputValue("[name='threshold_time']", data.emergency.threshold_time, {}, form);
|
||||||
|
|
||||||
} else if (section === 'equitherm') {
|
} else if (section === 'equitherm') {
|
||||||
setCheckboxValue("[name='enabled']", data.equitherm.enabled, form);
|
setCheckboxValue("[name='enabled']", data.equitherm.enabled, form);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const convertLegacyBackup = (data) => {
|
|||||||
thresholdHigh: 'threshold_high',
|
thresholdHigh: 'threshold_high',
|
||||||
thresholdLow: 'threshold_low',
|
thresholdLow: 'threshold_low',
|
||||||
thresholdTime: 'threshold_time',
|
thresholdTime: 'threshold_time',
|
||||||
tresholdTime: 'treshold_time',
|
tresholdTime: 'threshold_time',
|
||||||
turboFactor: 'turbo_factor',
|
turboFactor: 'turbo_factor',
|
||||||
unitSystem: 'unit_system',
|
unitSystem: 'unit_system',
|
||||||
useDhcp: 'use_dhcp',
|
useDhcp: 'use_dhcp',
|
||||||
|
|||||||
Reference in new issue
Block a user