Commit Graph
23078 Commits
Author SHA1 Message Date
J. Nick Koston 9bf34be20d Merge remote-tracking branch 'upstream/dev' into integration 2026-02-23 12:07:15 -06:00
J. Nick Koston f3162b2472 Merge remote-tracking branch 'upstream/fix-ble-client-disconnect-race' into integration 2026-02-23 12:00:25 -06:00
J. Nick KostonandClaude Opus 4.6 5c86bad64b [esp32_ble_client] Add 10s safety timeout for DISCONNECTING state
If CLOSE_EVT never arrives after DISCONNECT_EVT, the client gets
stuck in DISCONNECTING forever, blocking reconnection and scanner
restart. Add a 10s timeout watchdog in loop() that forces IDLE
as a recovery path.

Introduce set_disconnecting_() helper to ensure the timeout
timestamp is always set when entering DISCONNECTING state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:53:44 -06:00
J. Nick KostonandClaude Opus 4.6 60944a6d8b [esp32_ble_client] Improve log message when connect blocked by DISCONNECTING
Separate the DISCONNECTING state into its own log message that
mentions waiting for CLOSE_EVT, making it easier to diagnose
stuck connections vs normal in-progress connections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:37:00 -06:00
J. Nick KostonandClaude Opus 4.6 5fcb7294ba [esp32_ble_client] Improve log message when connect blocked by DISCONNECTING
Separate the DISCONNECTING state into its own log message that
mentions waiting for CLOSE_EVT, making it easier to diagnose
stuck connections vs normal in-progress connections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:36:46 -06:00
1f945a334a [hdc302x] Add new component (#10160)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-23 12:01:23 -05:00
J. Nick Koston 79f47216cd Merge branch 'fix-ble-client-disconnect-race' into integration 2026-02-23 09:55:51 -06:00
J. Nick KostonandClaude Opus 4.6 1dba01e05b [esp32_ble_client] Don't reset conn_id_ in want_disconnect_ path
The CLOSE_EVT handler matches on conn_id_ to call set_idle_().
Resetting conn_id_ to UNSET_CONN_ID before CLOSE_EVT arrives
causes the event to be dropped, leaving the client stuck in
DISCONNECTING state permanently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:48:23 -06:00
J. Nick Koston a0b69effe4 [esp32_ble_client] Move set_idle_() to header for inlining 2026-02-23 09:35:47 -06:00
J. Nick Koston 22d9f50034 [esp32_ble_client] Extract set_idle_() helper for IDLE + conn_id reset
Consolidate the repeated set_state(IDLE) + conn_id_ = UNSET_CONN_ID
pattern into a single helper to ensure they always stay paired.
2026-02-23 09:34:57 -06:00
J. Nick Koston a5fc6b480a [esp32_ble_client] Add comment for conn_id reset on failed OPEN_EVT 2026-02-23 09:33:49 -06:00
J. Nick Koston 39c5cffaa1 [esp32_ble_client] Reset conn_id on failed OPEN_EVT to prevent stale match
When OPEN_EVT arrives with a failure status, the connection was never
established so no CLOSE_EVT may follow. Reset conn_id_ to prevent a
stale value from matching a future CLOSE_EVT.
2026-02-23 09:32:55 -06:00
J. Nick Koston c75b7de2d3 [esp32_ble_client] Let failed OPEN_EVT in DISCONNECTING state fall through to existing handler
Instead of a separate early-return for DISCONNECTING state, let the
failed OPEN_EVT fall through to the existing failed-status handler
which already transitions to IDLE.
2026-02-23 09:32:13 -06:00
J. Nick Koston 246d455dc3 [esp32_ble_client] Complete disconnection on failed OPEN_EVT in DISCONNECTING state
When a connection fails to establish, the ESP-IDF stack sends
DISCONNECT_EVT followed by OPEN_EVT with a failure status (e.g. 133).
No CLOSE_EVT follows since no GATT connection was established.

Previously the OPEN_EVT in DISCONNECTING state was silently ignored,
leaving the client stuck in DISCONNECTING forever. Now we treat this
failed OPEN_EVT as the terminal event and transition to IDLE.
2026-02-23 09:28:50 -06:00
Jonathan SwobodaandClaude Opus 4.6 fb6c7d81d5 [core] Fix multiline log continuations without leading whitespace (#14217)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 05:08:40 +00:00
J. Nick Koston c6dec97d47 Merge remote-tracking branch 'origin/lock-free-queue-avoid-modulo' into integration 2026-02-22 22:50:07 -06:00
J. Nick Koston 25c3c79809 Rename next_index_ to next_index for static method naming convention
Static methods should not have trailing underscore per clang-tidy
readability-identifier-naming rules.
2026-02-22 22:47:19 -06:00
J. Nick Koston 11095bc15e [core] Avoid expensive modulo in LockFreeQueue for non-power-of-2 sizes
Replace modulo-based ring buffer index advancement with constexpr-dispatched
approach: power-of-2 sizes keep modulo (compiler emits single mask instruction),
non-power-of-2 sizes use comparison+branch instead of multiply-shift sequences.

Benchmarked on real ESP32-C3 (RISC-V) hardware (100k iterations):
- SIZE=88 (BLE):  24,120 us -> 6,493 us (3.7x faster)
- SIZE=30 (MQTT): 22,816 us -> 6,879 us (3.3x faster)
- SIZE=32 (pow2): identical (both use mask)

Flash savings on ESP32 Xtensa (BLE proxy build):
- push(): 149 -> 133 bytes (-16 B)
- pop():   78 ->  67 bytes (-11 B)
2026-02-22 22:41:22 -06:00
J. Nick Koston 417f4535af [logger] Use subtraction-based line number formatting to avoid division (#14219) 2026-02-23 04:25:20 +00:00
J. Nick Koston b0a35d25ca Merge remote-tracking branch 'upstream/dev' into integration 2026-02-22 21:46:44 -06:00
schrob ee94bc4715 [openthread] Refactor to optimize and match code rules (#14156) 2026-02-22 22:43:42 -05:00
schrob 6801604533 [openthread] Add Thread version DEBUG trace (#14196) 2026-02-22 22:40:40 -05:00
schrob 5c388a5200 [openthread_info] Optimize: Devirtualize/unify (#14208) 2026-02-22 22:39:36 -05:00
J. Nick Koston 7f4a058e0f Merge branch 'logger-subtract-line-format' into integration 2026-02-22 21:39:34 -06:00
J. Nick Koston bb750ba088 Drop unnecessary LogBuffer:: qualification on write_digit calls 2026-02-22 21:39:13 -06:00
J. Nick Koston 739c013753 Merge branch 'logger-subtract-line-format' into integration 2026-02-22 21:38:06 -06:00
J. Nick Koston cc85086c08 Force inline write_digit to prevent separate symbol emission 2026-02-22 21:37:44 -06:00
J. Nick Koston d239a2400d [text_sensor] Conditionally compile filter infrastructure (#14213) 2026-02-22 21:36:21 -06:00
J. Nick KostonandClaude Opus 4.6 93ce582ad3 [sensor] Conditionally compile filter infrastructure (#14214)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:35:51 -06:00
J. Nick Koston 6e70987451 [binary_sensor] Conditionally compile filter infrastructure (#14215) 2026-02-22 21:35:30 -06:00
J. Nick Koston 80a8ec7973 Merge branch 'logger-subtract-line-format' into integration 2026-02-22 21:35:06 -06:00
schrob 263fff0ba2 Move CONF_OUTPUT_POWER into const.py (#14201) 2026-02-22 22:35:00 -05: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
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 KostonandClaude Opus 4.6 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 KostonandClaude Opus 4.6 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 KostonandClaude Opus 4.6 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