Replace the heap-allocated tx_buffer_ (new char[]) with a compile-time
sized inline array using ESPHOME_LOGGER_TX_BUFFER_SIZE define. This
eliminates a heap allocation during Logger construction, saving ~513
bytes of heap on memory-constrained devices like BK72xx.
Changes:
- Add ESPHOME_LOGGER_TX_BUFFER_SIZE define set from Python config
- Change tx_buffer_ from char* to char[ESPHOME_LOGGER_TX_BUFFER_SIZE+1]
- Remove tx_buffer_size_ member field
- Update constructor to no longer take tx_buffer_size parameter
- Update all references to use the compile-time constant
WebServerBase was registered as a Component but never used the lifecycle -
no setup(), loop(), or dump_config(). The get_setup_priority() override
was dead code since there was nothing to schedule. It is just a shared
base class that holds the AsyncWebServer and handler list, with init/deinit
called manually by consumers via reference counting.
- Remove Component inheritance and register_component call
- Use C++17 nested namespace syntax
- Replace unique_ptr<AsyncWebServer> with raw pointer (server is never
deleted in practice - device runs until power loss)
- Remove unused includes (memory, component.h, application.h, helpers.h, log.h)
Replace the unwieldy 6-tuple with a frozen dataclass for clarity
and named attribute access at call sites.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Clarify MIN_TCP_SOCKETS comment: covers minimal configs (api-only);
when web_server is present its 5 sockets push past the minimum.
- Add MIN_TCP_LISTEN_SOCKETS = 2 alongside MIN_TCP/MIN_UDP for
consistency instead of hardcoding the value in libretiny.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BK SDK sets TCP_SND_BUF=10×MSS on both plans but TCP_WND varies:
3×MSS (reduced plan) vs 10×MSS (default plan). Also update stale
minimum counts in docstring (8 TCP / 6 UDP).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previous minimums (10/8) were overly conservative. Most configs
register their actual needs via consume_sockets(), so the minimums
only need to cover unregistered components with modest headroom.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
get_socket_counts() now returns component detail strings alongside
counts so platforms can include them in their log messages. ESP32
INFO log now shows which components consume each socket type.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>