From edd755323c9c39548393bbad5e29fba471b59bef Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 13 May 2025 21:11:19 -0500 Subject: [PATCH] true --- esphome/components/api/api_connection.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/api/api_connection.h b/esphome/components/api/api_connection.h index 08061ade4c..a406629028 100644 --- a/esphome/components/api/api_connection.h +++ b/esphome/components/api/api_connection.h @@ -434,7 +434,7 @@ class APIConnection : public APIServerConnection { template bool send_state_(EntityT *entity, bool (APIConnection::*try_send_func)(EntityT *)) { if (!this->state_subscription_) return false; - if (this->try_to_clear_buffer() && (this->*try_send_func)(entity)) { + if (this->try_to_clear_buffer(true) && (this->*try_send_func)(entity)) { return true; } this->deferred_message_queue_.defer(entity, reinterpret_cast(try_send_func)); @@ -464,7 +464,7 @@ class APIConnection : public APIServerConnection { Args... args) { if (!this->state_subscription_) return false; - if (this->try_to_clear_buffer() && (this->*try_send_state_func)(entity, state, args...)) { + if (this->try_to_clear_buffer(true) && (this->*try_send_state_func)(entity, state, args...)) { return true; } this->deferred_message_queue_.defer(entity, reinterpret_cast(try_send_entity_func)); @@ -479,7 +479,7 @@ class APIConnection : public APIServerConnection { * @param try_send_func The function that tries to send the info */ template void send_info_(EntityT *entity, bool (APIConnection::*try_send_func)(EntityT *)) { - if (this->try_to_clear_buffer() && (this->*try_send_func)(entity)) { + if (this->try_to_clear_buffer(true) && (this->*try_send_func)(entity)) { return; } this->deferred_message_queue_.defer(entity, reinterpret_cast(try_send_func));