mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 04:36:31 +00:00
Sync global value update with teleperiod
Sync global value update with teleperiod (#15834)
This commit is contained in:
parent
d7cbb73d5b
commit
ee909d4372
@ -865,7 +865,7 @@ void GetSensorValues(void) {
|
|||||||
float value = -9999;
|
float value = -9999;
|
||||||
uint32_t idx = 0;
|
uint32_t idx = 0;
|
||||||
// char *data = ResponseData();
|
// char *data = ResponseData();
|
||||||
char *data = start;
|
char *data = start; // Invalid JSON ,"HTU21":{"Temperature":30.7,"Humidity":39.0,"DewPoint":15.2},"BME680":{"Temperature":30.0,"Humidity":50.4,"DewPoint":18.5,"Pressure":1009.6,"Gas":1660.52},"ESP32":{"Temperature":53.3}
|
||||||
while (data) {
|
while (data) {
|
||||||
data = strstr(data, key);
|
data = strstr(data, key);
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -1078,18 +1078,18 @@ void PerformEverySecond(void)
|
|||||||
|
|
||||||
XsnsCall(FUNC_AFTER_TELEPERIOD);
|
XsnsCall(FUNC_AFTER_TELEPERIOD);
|
||||||
XdrvCall(FUNC_AFTER_TELEPERIOD);
|
XdrvCall(FUNC_AFTER_TELEPERIOD);
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Global values (Temperature, Humidity and Pressure) update every 10 seconds
|
// Global values (Temperature, Humidity and Pressure) update every 10 seconds
|
||||||
if (!(TasmotaGlobal.uptime % 10)) {
|
if (!(TasmotaGlobal.tele_period % 10)) {
|
||||||
for (uint32_t type = 0; type < 3; type++) {
|
for (uint32_t type = 0; type < 3; type++) {
|
||||||
if (!Settings->global_sensor_index[type] || TasmotaGlobal.user_globals[type]) { continue; }
|
if (!Settings->global_sensor_index[type] || TasmotaGlobal.user_globals[type]) { continue; }
|
||||||
GetSensorValues();
|
GetSensorValues();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
// Wifi keep alive to send Gratuitous ARP
|
// Wifi keep alive to send Gratuitous ARP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user