mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-15 20:30:01 +03:00
removelast topic/payload
This commit is contained in:
@@ -58,8 +58,6 @@ uint8_t Mqtt::connectcount_ = 0;
|
|||||||
uint32_t Mqtt::mqtt_message_id_ = 0;
|
uint32_t Mqtt::mqtt_message_id_ = 0;
|
||||||
char will_topic_[Mqtt::MQTT_TOPIC_MAX_SIZE]; // because MQTT library keeps only char pointer
|
char will_topic_[Mqtt::MQTT_TOPIC_MAX_SIZE]; // because MQTT library keeps only char pointer
|
||||||
|
|
||||||
std::string Mqtt::lasttopic_ = "";
|
|
||||||
std::string Mqtt::lastpayload_ = "";
|
|
||||||
std::string Mqtt::lastresponse_ = "";
|
std::string Mqtt::lastresponse_ = "";
|
||||||
|
|
||||||
// Home Assistant specific
|
// Home Assistant specific
|
||||||
@@ -244,12 +242,6 @@ void Mqtt::on_message(const char * topic, const uint8_t * payload, size_t len) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for misconfigured mqtt servers and publish2command ignore echos
|
|
||||||
if (publish_single_ && publish_single2cmd_ && lasttopic_ == topic && lastpayload_ == message) {
|
|
||||||
LOG_DEBUG("Received echo message %s: %s", topic, message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check first against any of our subscribed topics
|
// check first against any of our subscribed topics
|
||||||
for (const auto & mf : mqtt_subfunctions_) {
|
for (const auto & mf : mqtt_subfunctions_) {
|
||||||
// add the base back
|
// add the base back
|
||||||
|
|||||||
@@ -310,8 +310,6 @@ class Mqtt {
|
|||||||
static uint8_t connectcount_;
|
static uint8_t connectcount_;
|
||||||
static bool ha_climate_reset_;
|
static bool ha_climate_reset_;
|
||||||
|
|
||||||
static std::string lasttopic_;
|
|
||||||
static std::string lastpayload_;
|
|
||||||
static std::string lastresponse_;
|
static std::string lastresponse_;
|
||||||
|
|
||||||
// settings, copied over
|
// settings, copied over
|
||||||
|
|||||||
Reference in New Issue
Block a user