dont queue mqtt if not connected, dev.4e

This commit is contained in:
MichaelDvP
2023-10-25 17:44:30 +02:00
parent 4a7d69c797
commit 96fe9aeb31
2 changed files with 3 additions and 2 deletions

View File

@@ -472,6 +472,7 @@ void Mqtt::on_disconnect(espMqttClientTypes::DisconnectReason reason) {
} else {
LOG_WARNING("MQTT disconnected: code %d", reason);
}
mqttClient_->clearQueue(true);
}
// MQTT on_connect - when an MQTT connect is established
@@ -589,7 +590,7 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
return true;
}
}
if (!mqtt_enabled_ || topic.empty()) {
if (!mqtt_enabled_ || topic.empty() || !connected()) {
return false; // quit, not using MQTT
}
// check free mem

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.6.3-dev.4d"
#define EMSESP_APP_VERSION "3.6.3-dev.4e"