Commit Graph

23047 Commits

Author SHA1 Message Date
J. Nick Koston
80a8ec7973 Merge branch 'logger-subtract-line-format' into integration 2026-02-22 21:35:06 -06:00
J. Nick Koston
4eeeeb7c81 Fix clang-tidy: use qualified name for static method, remove trailing underscore 2026-02-22 21:34:32 -06:00
J. Nick Koston
602eefd72c Merge remote-tracking branch 'origin/logger-subtract-line-format' into integration 2026-02-22 21:31:24 -06:00
J. Nick Koston
6b9e1045c0 [logger] Use subtraction-based line number formatting to avoid division
Replace division-based line number formatting in LogBuffer::write_header
with subtraction loops. The ESP8266 (Xtensa lx106) lacks a hardware
divider, so each division compiles to an expensive software function call.

Measured on real ESP8266 hardware (10000 iterations x 13 test values):
- Division: 213,029 us
- Subtraction: 118,503 us (1.8x faster)

Flash savings:
- ESP8266: -36 bytes (323 -> 287)
- ESP32: -23 bytes (326 -> 303)
2026-02-22 21:30:05 -06:00
J. Nick Koston
ded457c2c1 [libretiny] Tune oversized lwIP defaults for ESPHome (#14186)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-23 13:52:46 +13:00
J. Nick Koston
3145798d68 Merge branch 'ifdef-sensor-filter' into integration 2026-02-22 18:18:51 -06:00
J. Nick Koston
3490311123 Add missing #include for components relying on transitive includes
sound_level and wireguard were getting automation.h transitively
through sensor/filter.h. Now that filter.h is conditionally compiled,
add the direct includes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:18:15 -06:00
J. Nick Koston
eace7c80b9 Merge branch 'ifdef-text-sensor-filter' into integration 2026-02-22 18:06:18 -06:00
J. Nick Koston
aa4ebb5d08 Merge remote-tracking branch 'origin/ifdef-sensor-filter' into integration 2026-02-22 17:50:52 -06:00
J. Nick Koston
c3c45a16c9 Remove unused #include <queue> from sensor/filter.h
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 17:50:32 -06:00
J. Nick Koston
04c497edff Merge remote-tracking branch 'origin/ifdef-sensor-filter' into integration 2026-02-22 17:48:55 -06:00
J. Nick Koston
8f18f8e736 Add missing #include <queue> for components relying on transitive include
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>
2026-02-22 17:47:15 -06:00
J. Nick Koston
5aa709d263 Merge remote-tracking branch 'origin/ifdef-sensor-filter' into integration 2026-02-22 17:33:32 -06:00
J. Nick Koston
f11933ecfa Merge remote-tracking branch 'origin/ifdef-binary-sensor-filter' into integration 2026-02-22 17:33:11 -06:00
J. Nick Koston
79ad75b2c5 [binary_sensor] Conditionally compile filter infrastructure with USE_BINARY_SENSOR_FILTER
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.
2026-02-22 17:27:31 -06:00
J. Nick Koston
f5765f318c [sensor] Conditionally compile filter infrastructure with USE_SENSOR_FILTER
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.
2026-02-22 17:25:40 -06:00
J. Nick Koston
b8a6deddf5 [text_sensor] Conditionally compile filter infrastructure with USE_TEXT_SENSOR_FILTER
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.
2026-02-22 17:23:01 -06:00
J. Nick Koston
b539a5aa51 [water_heater] Fix device_id missing from state responses (#14212) 2026-02-22 23:07:56 +00:00
J. Nick Koston
5fddce6638 [logger] Make tx_buffer_ compile-time sized (#14205) 2026-02-23 12:02:05 +13:00
J. Nick Koston
22a38f48b9 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-22 17:00:59 -06:00
J. Nick Koston
ee1f521325 [http_request] Replace std::list<Header> with std::vector in perform() chain (#14027) 2026-02-23 11:59:54 +13:00
J. Nick Koston
bd7e1e8526 Merge remote-tracking branch 'origin/fix-water-heater-device-id' into integration 2026-02-22 16:58:32 -06:00
J. Nick Koston
cdb2e32518 [water_heater] Fix device_id missing from state responses
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
2026-02-22 16:43:08 -06:00
J. Nick Koston
ede2da2fbc [core] Conditionally compile get_loop_priority with USE_LOOP_PRIORITY (#14210) 2026-02-23 10:57:23 +13:00
J. Nick Koston
509f06afac [network] Improve IPAddress::str() deprecation warning with usage example (#14195) 2026-02-23 10:56:09 +13:00
J. Nick Koston
332b6e61b3 Merge remote-tracking branch 'upstream/fix-ble-client-disconnect-race' into integration 2026-02-22 15:44:10 -06:00
J. Nick Koston
3ae3242362 [esp32_ble_client] Defer IDLE transition from DISCONNECT_EVT to CLOSE_EVT
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
2026-02-22 15:42:39 -06:00
J. Nick Koston
819143d526 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-22 15:25:01 -06:00
J. Nick Koston
1753074eef [web_server_base] Remove unnecessary Component inheritance and modernize (#14204) 2026-02-23 10:01:07 +13:00
J. Nick Koston
217363464a Merge branch 'conditionally-compile-loop-priority' into integration 2026-02-22 14:30:52 -06:00
J. Nick Koston
ac42d5e75e [core] Conditionally compile get_loop_priority with USE_LOOP_PRIORITY 2026-02-22 14:24:31 -06:00
J. Nick Koston
fc56165440 Merge remote-tracking branch 'origin/logger-compile-time-tx-buffer' into integration 2026-02-22 13:52:53 -06:00
J. Nick Koston
649aec69d7 [logger] Make tx_buffer_ compile-time sized
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
2026-02-22 12:56:28 -06:00
J. Nick Koston
9eb0bac2f3 Merge branch 'logger-compile-time-tx-buffer' into integration 2026-02-22 12:07:07 -06:00
J. Nick Koston
92c1b1d481 Merge branch 'web_server_base_cleanup' into integration 2026-02-22 11:59:29 -06:00
J. Nick Koston
5101250eae [logger] Make tx_buffer_ compile-time sized
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
2026-02-22 11:57:36 -06:00
J. Nick Koston
5e7a400dc3 [web_server_base] Remove unnecessary Component inheritance and modernize
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)
2026-02-22 11:37:15 -06:00
J. Nick Koston
7d8a103718 Merge branch 'setup_heap_stats' into integration 2026-02-22 10:53:42 -06:00
J. Nick Koston
bdaebe48d6 Merge branch 'dev' into setup_heap_stats 2026-02-22 10:53:21 -06:00
J. Nick Koston
1fa340c6a4 Merge remote-tracking branch 'origin/dev' into integration 2026-02-22 10:23:01 -06:00
Edward Firmo
e013b48675 [nextion] Add error log for failed HTTP status during TFT upload (#14190) 2026-02-21 23:44:06 -06:00
J. Nick Koston
49e4ae54be [bme68x_bsec2] Fix compilation on ESP32 Arduino (#14194) 2026-02-22 05:22:59 +00:00
J. Nick Koston
c98b955881 Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-02-21 22:13:39 -06:00
J. Nick Koston
5fd0ee1717 Merge branch 'dev' into pack-entity-strings 2026-02-21 22:12:49 -06:00
J. Nick Koston
50e2f62c89 Merge remote-tracking branch 'origin/integration' into integration 2026-02-21 22:10:16 -06:00
J. Nick Koston
655968af66 Merge remote-tracking branch 'origin/api-stringref-user-services' into integration 2026-02-21 22:10:03 -06:00
J. Nick Koston
c636984e3a deferred 2026-02-21 21:53:57 -06:00
J. Nick Koston
e1e20422a6 deferred 2026-02-21 21:47:03 -06:00
J. Nick Koston
1183aae319 deferred 2026-02-21 21:38:03 -06:00
J. Nick Koston
b6e8e92416 deferred 2026-02-21 21:34:07 -06:00