mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
dont allow not_connected_publish, fix mqtt success/fail counters, v3.7.0-dev1a
This commit is contained in:
@@ -37,7 +37,7 @@ the LICENSE file.
|
||||
#endif
|
||||
|
||||
#ifndef EMC_ALLOW_NOT_CONNECTED_PUBLISH
|
||||
#define EMC_ALLOW_NOT_CONNECTED_PUBLISH 1
|
||||
#define EMC_ALLOW_NOT_CONNECTED_PUBLISH 0
|
||||
#endif
|
||||
|
||||
#ifndef EMC_WAIT_FOR_CONNACK
|
||||
|
||||
@@ -506,7 +506,7 @@ void Mqtt::on_connect() {
|
||||
// publish to the last will topic (see Mqtt::start() function) to say we're alive
|
||||
queue_publish_retain("status", "online", true); // with retain on
|
||||
|
||||
mqtt_publish_fails_ = 0; // reset fail count to 0
|
||||
// mqtt_publish_fails_ = 0; // reset fail count to 0
|
||||
}
|
||||
|
||||
// Home Assistant Discovery - the main master Device called EMS-ESP
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.7.0-dev.1"
|
||||
#define EMSESP_APP_VERSION "3.7.0-dev.1a"
|
||||
|
||||
@@ -166,9 +166,9 @@ void WebStatusService::webStatusService(AsyncWebServerRequest * request) {
|
||||
if (Mqtt::enabled()) {
|
||||
statJson = statsJson.createNestedObject();
|
||||
statJson["id"] = 5;
|
||||
statJson["s"] = Mqtt::publish_count();
|
||||
statJson["s"] = Mqtt::publish_count() - Mqtt::publish_fails();
|
||||
statJson["f"] = Mqtt::publish_fails();
|
||||
statJson["q"] = Mqtt::publish_count() == 0 ? 100 : 100 - (uint8_t)((100 * Mqtt::publish_fails()) / (Mqtt::publish_count() + Mqtt::publish_fails()));
|
||||
statJson["q"] = Mqtt::publish_count() == 0 ? 100 : 100 - (uint8_t)((100 * Mqtt::publish_fails()) / Mqtt::publish_count());
|
||||
}
|
||||
|
||||
statJson = statsJson.createNestedObject();
|
||||
|
||||
Reference in New Issue
Block a user