From a8b9ca0b4cfcde22e528f2897a730f45666efe53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20K?= Date: Tue, 31 Jan 2023 11:51:21 +0100 Subject: [PATCH] don't send "0" for CH0 YT YD at reboot --- src/publisher/pubMqtt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/publisher/pubMqtt.h b/src/publisher/pubMqtt.h index ec3465d9..8b5b7dce 100644 --- a/src/publisher/pubMqtt.h +++ b/src/publisher/pubMqtt.h @@ -145,12 +145,12 @@ class PubMqtt { iv->setValue(pos, rec, 0.0f); snprintf(topic, 32 + MAX_NAME_LENGTH, "%s/ch0/%s", iv->config->name, fields[FLD_YD]); - snprintf(val, 4, "0.0"); + snprintf(val, 2, "0"); publish(topic, val, true); } // set Total YieldDay to zero snprintf(topic, 32 + MAX_NAME_LENGTH, "total/%s", fields[FLD_YD]); - snprintf(val, 4, "0.0"); + snprintf(val, 2, "0"); publish(topic, val, true); } void payloadEventListener(uint8_t cmd) { @@ -484,7 +484,7 @@ class PubMqtt { if(changed) { snprintf(val, 32, "%d", ((allAvail) ? MQTT_STATUS_ONLINE : ((mIvAvail) ? MQTT_STATUS_PARTIAL : MQTT_STATUS_OFFLINE))); publish("status", val, true); - sendIvData(false); // false prevents loop of same function + //sendIvData(false); // false prevents loop of same function } return totalComplete;