Skip to content

Commit

Permalink
dont queue publish on change if not connected, keep flag
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Sep 18, 2023
1 parent a6b0c74 commit 42a4c79
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
@@ -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
9 changes: 6 additions & 3 deletions src/emsesp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,9 +927,12 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> 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
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.6.2-dev.0a"
#define EMSESP_APP_VERSION "3.6.2-dev.0b"

0 comments on commit 42a4c79

Please sign in to comment.