mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 08:39:09 +03:00
set lastresponse also if not connected
This commit is contained in:
@@ -595,10 +595,6 @@ void Mqtt::ha_status() {
|
|||||||
// add sub or pub task to the queue.
|
// add sub or pub task to the queue.
|
||||||
// the base is not included in the topic
|
// the base is not included in the topic
|
||||||
bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, const std::string & payload, const bool retain) {
|
bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, const std::string & payload, const bool retain) {
|
||||||
if (!mqtt_enabled_ || topic.empty() || !connected()) {
|
|
||||||
return false; // quit, not using MQTT
|
|
||||||
}
|
|
||||||
|
|
||||||
if (topic == "response" && operation == Operation::PUBLISH) {
|
if (topic == "response" && operation == Operation::PUBLISH) {
|
||||||
lastresponse_ = payload;
|
lastresponse_ = payload;
|
||||||
if (!send_response_) {
|
if (!send_response_) {
|
||||||
@@ -606,6 +602,10 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mqtt_enabled_ || topic.empty() || !connected()) {
|
||||||
|
return false; // quit, not using MQTT
|
||||||
|
}
|
||||||
|
|
||||||
// check free mem
|
// check free mem
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
// if (ESP.getFreeHeap() < 60 * 1024 || ESP.getMaxAllocHeap() < 40 * 1024) {
|
// if (ESP.getFreeHeap() < 60 * 1024 || ESP.getMaxAllocHeap() < 40 * 1024) {
|
||||||
|
|||||||
Reference in New Issue
Block a user