From 721bb4143bd5b36fa453beace57c301e40daa7a8 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 6 Apr 2022 09:45:17 +0200 Subject: [PATCH] Limit number of possible influxdb publish situations Limit number of possible influxdb publish situations (#15257) --- tasmota/xdrv_02_9_mqtt.ino | 3 +++ tasmota/xdrv_interface.ino | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tasmota/xdrv_02_9_mqtt.ino b/tasmota/xdrv_02_9_mqtt.ino index 04834fe20..05432e965 100644 --- a/tasmota/xdrv_02_9_mqtt.ino +++ b/tasmota/xdrv_02_9_mqtt.ino @@ -791,6 +791,9 @@ void MqttPublishPrefixTopicRulesProcess_P(uint32_t prefix, const char* subtopic) void MqttPublishTeleSensor(void) { // Publish tele//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 } diff --git a/tasmota/xdrv_interface.ino b/tasmota/xdrv_interface.ino index cec38d34e..dcf763935 100644 --- a/tasmota/xdrv_interface.ino +++ b/tasmota/xdrv_interface.ino @@ -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; }