1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 23:22:21 +01:00

Optimize API flash usage by storing message size at compile time (#9447)

This commit is contained in:
J. Nick Koston
2025-07-11 14:38:23 -10:00
committed by GitHub
parent 983db6215f
commit 143bf694c7
9 changed files with 358 additions and 471 deletions

View File

@@ -475,7 +475,8 @@ void APIServer::on_shutdown() {
if (!c->send_message(DisconnectRequest())) {
// If we can't send the disconnect request directly (tx_buffer full),
// schedule it at the front of the batch so it will be sent with priority
c->schedule_message_front_(nullptr, &APIConnection::try_send_disconnect_request, DisconnectRequest::MESSAGE_TYPE);
c->schedule_message_front_(nullptr, &APIConnection::try_send_disconnect_request, DisconnectRequest::MESSAGE_TYPE,
DisconnectRequest::ESTIMATED_SIZE);
}
}
}