show MQTT connection error only once on the first connect failure

This commit is contained in:
proddy
2026-08-09 12:28:17 +02:00
parent e4d127db67
commit 9c992d8fda
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -472,8 +472,8 @@ bool Mqtt::get_publish_onchange(uint8_t device_type) {
return false;
}
void Mqtt::on_disconnect(espMqttClientTypes::DisconnectReason reason) {
// only show the error once, not every 2 seconds
if (!connecting_) {
// only show the error once on the first connect failure
if (connectcount_) {
return;
}
connecting_ = false;