From 42a4c792adae7086041e14597253b84a2a376a85 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Mon, 18 Sep 2023 16:24:24 +0200 Subject: [PATCH] dont queue publish on change if not connected, keep flag --- CHANGELOG_LATEST.md | 10 +++++++++- src/emsesp.cpp | 9 ++++++--- src/version.h | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 8ee694d5f..1c68f664c 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -1,11 +1,19 @@ # Changelog -## [3.6.1] +## [3.6.2] ## **IMPORTANT! BREAKING CHANGES** ## Added +- power entities +- optional input of BSSID for AP connection +- message "no entries" in info of scheduler/custom/analogsnesor/temperaturesensor + ## Fixed +- wifi full scan to get strongest AP + ## Changed + +- dont queue publish on change messages, but keep changed flag to send after reconnect diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 354eebc5b..a4bc59646 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -927,9 +927,12 @@ bool EMSESP::process_telegram(std::shared_ptr telegram) { if (telegram->type_id == publish_id_) { publish_id_ = 0; } - emsdevice->has_update(false); // reset flag - if (!Mqtt::publish_single()) { - publish_device_values(emsdevice->device_type()); // publish to MQTT if we explicitly have too + // dont publish if not connected and don't reset flag, so publish is done after reconnect + if (Mqtt::connected()) { + emsdevice->has_update(false); // reset flag + if (!Mqtt::publish_single()) { + publish_device_values(emsdevice->device_type()); // publish to MQTT if we explicitly have too + } } } } diff --git a/src/version.h b/src/version.h index 3f20b9401..a5903c191 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.6.2-dev.0a" +#define EMSESP_APP_VERSION "3.6.2-dev.0b"