mirror of
https://github.com/esphome/esphome.git
synced 2025-08-10 12:27:46 +00:00
Merge branch 'batch_ping_fallback' into integration
This commit is contained in:
@@ -168,18 +168,6 @@ void APIConnection::loop() {
|
|||||||
ESP_LOGVV(TAG, "Failed to send ping directly, scheduling at front of batch");
|
ESP_LOGVV(TAG, "Failed to send ping directly, scheduling at front of batch");
|
||||||
this->schedule_message_front_(nullptr, &APIConnection::try_send_ping_request, PingRequest::MESSAGE_TYPE);
|
this->schedule_message_front_(nullptr, &APIConnection::try_send_ping_request, PingRequest::MESSAGE_TYPE);
|
||||||
this->sent_ping_ = true; // Mark as sent to avoid scheduling multiple pings
|
this->sent_ping_ = true; // Mark as sent to avoid scheduling multiple pings
|
||||||
|
|
||||||
// Also set up retry tracking from upstream
|
|
||||||
this->next_ping_retry_ = now + PING_RETRY_INTERVAL;
|
|
||||||
this->ping_retries_++;
|
|
||||||
if (this->ping_retries_ >= MAX_PING_RETRIES) {
|
|
||||||
on_fatal_error();
|
|
||||||
ESP_LOGE(TAG, "%s: Ping failed %u times", this->get_client_combined_info().c_str(), this->ping_retries_);
|
|
||||||
} else if (this->ping_retries_ >= 10) {
|
|
||||||
ESP_LOGW(TAG, "%s: Ping retry %u", this->get_client_combined_info().c_str(), this->ping_retries_);
|
|
||||||
} else {
|
|
||||||
ESP_LOGD(TAG, "%s: Ping retry %u", this->get_client_combined_info().c_str(), this->ping_retries_);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user