Fix user global entries

This commit is contained in:
Theo Arends 2022-06-23 00:06:05 +02:00
parent 6444e5ff8f
commit 14a0370507

View File

@ -803,7 +803,7 @@ void CmndGlobalTemp(void) {
// Temperature is now Celsius // Temperature is now Celsius
if ((temperature >= -50.0f) && (temperature <= 100.0f)) { if ((temperature >= -50.0f) && (temperature <= 100.0f)) {
TasmotaGlobal.temperature_celsius = temperature; TasmotaGlobal.temperature_celsius = temperature;
TasmotaGlobal.global_update = 1; // Keep global values just entered valid TasmotaGlobal.global_update = TasmotaGlobal.uptime;
TasmotaGlobal.user_globals[0] = 1; TasmotaGlobal.user_globals[0] = 1;
} }
} }
@ -823,7 +823,7 @@ void CmndGlobalHum(void) {
float humidity = CharToFloat(XdrvMailbox.data); float humidity = CharToFloat(XdrvMailbox.data);
if ((humidity >= 0.0f) && (humidity <= 100.0f)) { if ((humidity >= 0.0f) && (humidity <= 100.0f)) {
TasmotaGlobal.humidity = humidity; TasmotaGlobal.humidity = humidity;
TasmotaGlobal.global_update = 1; // Keep global values just entered valid TasmotaGlobal.global_update = TasmotaGlobal.uptime;
TasmotaGlobal.user_globals[1] = 1; TasmotaGlobal.user_globals[1] = 1;
} }
} }
@ -845,7 +845,7 @@ void CmndGlobalPress(void) {
// Pressure is now hPa // Pressure is now hPa
if ((pressure >= 0.0f) && (pressure <= 1200.0f)) { if ((pressure >= 0.0f) && (pressure <= 1200.0f)) {
TasmotaGlobal.pressure_hpa = pressure; TasmotaGlobal.pressure_hpa = pressure;
TasmotaGlobal.global_update = 1; // Keep global values just entered valid TasmotaGlobal.global_update = TasmotaGlobal.uptime;
TasmotaGlobal.user_globals[2] = 1; TasmotaGlobal.user_globals[2] = 1;
} }
} }