bme680_bsec, haier, and kamstrup_kmp were getting <queue> transitively
through sensor/filter.h. Now that filter.h is conditionally compiled,
add the direct include.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When no binary sensor filters are configured, the entire Filter class
hierarchy (filter.h/filter.cpp) is still compiled and linked into the
binary. This includes delayed_on, delayed_off, delayed_on_off, invert,
autorepeat, lambda, settle, and timeout filter classes.
Add USE_BINARY_SENSOR_FILTER define that is only emitted when at least
one binary sensor has filters configured. Wrap filter-related code
behind this define to eliminate dead code from the binary.
When no sensor filters are configured, the entire Filter class
hierarchy (filter.h/filter.cpp) is still compiled and linked into
the binary. This includes ~20 filter classes (sliding window, median,
quantile, exponential moving average, throttle, debounce, heartbeat,
delta, calibrate, clamp, NTC, streaming filters, etc.)
Add USE_SENSOR_FILTER define that is only emitted when at least one
sensor has filters configured. Wrap filter-related code behind this
define to eliminate dead code from the binary.
When no text sensor filters are configured, the entire Filter class
hierarchy (filter.h/filter.cpp) was still compiled and linked. This
pulled in std::string manipulation code (_M_mutate, _M_create,
_M_append, _M_replace, _M_assign, _M_dispose) that is only needed
for filter chain processing.
Add USE_TEXT_SENSOR_FILTER define that is only emitted when at least
one text sensor has filters configured. Wrap filter-related code
behind this define to eliminate dead code from the binary.
Saves ~340 bytes of flash on configs with filterless text sensors.
Water heater was the only entity type that directly called
encode_message_to_buffer() instead of fill_and_encode_entity_state().
This meant device_id was never set on WaterHeaterStateResponse,
causing entities with device_id to show as unknown in Home Assistant.
Expand the device_id integration test to cover all entity types:
cover, fan, lock, number, select, text, valve, water_heater,
alarm_control_panel, date, time, datetime, and event.
Closes https://github.com/esphome/esphome/issues/14206
ESP_GATTC_DISCONNECT_EVT only indicates that the link-layer disconnection
has started, not that the controller has fully freed resources (L2CAP
channels, ATT resources, HCI connection handle). Transitioning to IDLE
immediately allowed reconnection attempts before cleanup was complete,
causing the controller to reject new connections with status=133
(ESP_GATT_CONN_FAIL_ESTABLISH) or crash with ASSERT_PARAM in lld_evt.c.
This applies the same fix that was made for bluetooth_proxy in #10303
to the base BLEClientBase class, which is used by the ble_client
component.
Changes:
- DISCONNECT_EVT now transitions to DISCONNECTING instead of IDLE
- CLOSE_EVT (already existing) handles the final IDLE transition
- connect() now blocks while in DISCONNECTING state
- OPEN_EVT ignores events received during DISCONNECTING state
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
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)