Limit number of possible influxdb publish situations

Limit number of possible influxdb publish situations (#15257)
This commit is contained in:
Theo Arends 2022-04-06 09:45:17 +02:00
parent 500a01db39
commit 721bb4143b
2 changed files with 4 additions and 7 deletions

View File

@ -791,6 +791,9 @@ void MqttPublishPrefixTopicRulesProcess_P(uint32_t prefix, const char* subtopic)
void MqttPublishTeleSensor(void) {
// Publish tele/<device>/SENSOR default ResponseData string with optional retained
// then process rules
#ifdef USE_INFLUXDB
InfluxDbProcess(1); // Use a copy of ResponseData
#endif
MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR), Settings->flag.mqtt_sensor_retain); // CMND_SENSORRETAIN
}

View File

@ -1093,14 +1093,8 @@ bool XdrvRulesProcess(bool teleperiod, const char* event) {
}
bool XdrvRulesProcess(bool teleperiod) {
#ifdef USE_INFLUXDB
if (!teleperiod) { // Only process ad-hoc data here
InfluxDbProcess(1); // Use a copy
}
#endif
bool result = XdrvRulesProcess(teleperiod, ResponseData());
ResponseClear(); // Free heap space
ResponseClear(); // Free heap space
return result;
}