Commit Graph

23110 Commits

Author SHA1 Message Date
J. Nick Koston
70bcbfaae6 Merge branch 'remove_posix_tz_parser' into integration 2026-02-23 16:43:21 -06:00
J. Nick Koston
199288b813 [time] Fix test namespace for RecalcTimestampLocal and TimezoneOffset tests
Move tests that use make_us_central(), set_global_tz(), ParsedTimezone,
and DSTRuleType into esphome::time::testing namespace where those symbols
are declared.
2026-02-23 16:41:20 -06:00
J. Nick Koston
8374ccf7b5 [time] Remove C++ POSIX TZ string parser (bridge code)
Remove the runtime POSIX TZ string parser and all associated bridge code
now that timezone data is sent as pre-parsed structs via protobuf.

Removed:
- parse_posix_tz() and internal parsing helpers (skip_tz_name, parse_offset,
  parse_dst_rule, parse_uint, parse_transition_time)
- RealTimeClock::set_timezone() overloads and apply_timezone_()
- API connection fallback path for string-based timezone

Kept:
- All conversion functions (epoch_to_local_tm, is_in_dst, calculate_dst_transition)
- Internal helpers used by conversion functions
- localtime_r/localtime overrides
- Tests for all permanent functions
2026-02-23 16:34:14 -06:00
J. Nick Koston
06981cd4d3 Merge remote-tracking branch 'upstream/wifi-manual-ip-esp8266-rodata' into integration 2026-02-23 16:13:28 -06:00
J. Nick Koston
abcd89cd1f [wifi] Avoid .rodata RAM cost for ManualIP on ESP8266
On ESP8266, .rodata is mapped to DRAM (RAM), not flash. When
StructInitializer is used with all compile-time constant fields,
the compiler places the entire struct as a const blob in .rodata,
silently consuming ~20 bytes of RAM.

Switch to field-by-field assignment on ESP8266 so the IP address
values are encoded as immediate operands in flash instructions
instead of a .rodata blob. Other platforms continue to use the
aggregate initializer since their .rodata is flash-mapped.
2026-02-23 16:06:28 -06:00
J. Nick Koston
3c54f15a18 Merge branch 'fix-incremental-rebuild' into integration
# Conflicts:
#	esphome/core/application.cpp
2026-02-23 16:03:41 -06:00
J. Nick Koston
5e94b10375 Merge branch 'posix_tz_proto' into integration 2026-02-23 16:02:34 -06:00
J. Nick Koston
a757838408 [time] Wrap codegen timezone fields in scope block
Fixes redeclaration error when multiple time platforms are in the
same build by wrapping the local ParsedTimezone variable in a scope block.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:49:35 -06:00
J. Nick Koston
4b400aa79a avoid ram increase 2026-02-23 15:42:39 -06:00
Jonathan Swoboda
e3aa732244 Fix 2026-02-23 16:36:33 -05:00
James Myatt
4a52900352 [nfc] Fix logging tag for nfc helpers (#14235) 2026-02-23 21:16:32 +00:00
Jonathan Swoboda
f21c69850c Fix 2026-02-23 16:09:57 -05:00
J. Nick Koston
ba11722e77 [time] Skip POSIX TZ validation for empty timezone strings
Empty timezone strings are valid (meaning UTC/no timezone).
The parse_posix_tz_python() validation should only run on
non-empty strings.
2026-02-23 15:00:25 -06:00
J. Nick Koston
49ddaa2002 Merge branch 'posix_tz' into posix_tz_proto 2026-02-23 14:49:09 -06:00
J. Nick Koston
1a99abc629 [time] Add context to test file about bridge code removal timeline 2026-02-23 14:45:37 -06:00
J. Nick Koston
f95d8a33e2 Merge branch 'posix_tz' into posix_tz_proto 2026-02-23 14:44:14 -06:00
J. Nick Koston
de01d766f1 [time] Mark posix_tz parser as bridge code to remove before 2026.9.0
The C++ POSIX TZ string parser is only needed for backward compatibility
with older Home Assistant clients that send the timezone as a string.
Once all clients send the pre-parsed ParsedTimezone protobuf struct,
the parser and its helpers can be removed entirely.

See https://github.com/esphome/backlog/issues/91
2026-02-23 14:43:57 -06:00
Jonathan Swoboda
79e567a3f1 Fix 2026-02-23 15:30:02 -05:00
J. Nick Koston
db6db5fb10 merge proto 2026-02-23 14:25:57 -06:00
Jonathan Swoboda
d324a6c9e6 [core] Move build_info_data.h out of application.h to fix incremental rebuilds
build_info_data.h contains ESPHOME_BUILD_TIME which changes every build.
Since application.h included it, changing any source file caused
build_info_data.h to be rewritten (via sources_changed), which then
triggered a rebuild of every file that includes application.h.

Move all build_info_data.h dependent code from application.h inline
methods to application.cpp, so only application.cpp recompiles when
build info changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 15:25:52 -05:00
J. Nick Koston
9e8efe15d3 Merge branch 'dev' into posix_tz 2026-02-23 14:25:26 -06:00
tomaszduda23
02c37bb6d6 [nrf52,logger] generate crash magic in python (#14173) 2026-02-23 20:23:40 +00:00
dependabot[bot]
918bbfb0d3 Bump aioesphomeapi from 44.0.0 to 44.1.0 (#14232)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-23 20:22:32 +00:00
tomaszduda23
063c6a9e45 [esp32,core] Move CONF_ENABLE_OTA_ROLLBACK to core (#14231) 2026-02-23 20:06:20 +00:00
Jonathan Swoboda
daee71a2c1 [http_request] Retry update check on startup until network is ready (#14228)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-23 14:21:29 -05:00
Jonathan Swoboda
a0b687354f [core] Move build_info_data.h out of application.h to fix incremental rebuilds
build_info_data.h contains ESPHOME_BUILD_TIME which changes every build.
Since application.h included it, changing any source file caused
build_info_data.h to be rewritten (via sources_changed), which then
triggered a rebuild of every file that includes application.h.

Move all build_info_data.h dependent code from application.h inline
methods to application.cpp, so only application.cpp recompiles when
build info changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 14:18:33 -05:00
Jonathan Swoboda
111340bda4 [core] Move build_info_data.h out of application.h to fix incremental rebuilds
build_info_data.h contains ESPHOME_BUILD_TIME which changes every build.
Since application.h included it, changing any source file caused
build_info_data.h to be rewritten (via sources_changed), which then
triggered a rebuild of every file that includes application.h.

Move all build_info_data.h dependent code from application.h inline
methods to application.cpp, so only application.cpp recompiles when
build info changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 14:13:25 -05:00
Jonathan Swoboda
8780ec29d9 [core] Move build_info_data.h out of application.h to fix incremental rebuilds
build_info_data.h contains ESPHOME_BUILD_TIME which changes every build.
Since application.h included it, changing any source file caused
build_info_data.h to be rewritten (via sources_changed), which then
triggered a rebuild of every file that includes application.h.

Move all build_info_data.h dependent code from application.h inline
methods to application.cpp, so only application.cpp recompiles when
build info changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 14:11:13 -05:00
Jonathan Swoboda
0d32a5321c [remote_transmitter/remote_receiver] Rename _esp32.cpp to _rmt.cpp (#14226)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 13:46:53 -05:00
J. Nick Koston
5e95b9b36c Merge branch 'dev' into posix_tz 2026-02-23 12:45:16 -06:00
Jonathan Swoboda
bea70b6cd2 [core] Move build_info_data.h out of application.h to fix incremental rebuilds
build_info_data.h contains ESPHOME_BUILD_TIME which changes every build.
Since application.h included it, changing any source file caused
build_info_data.h to be rewritten (via sources_changed), which then
triggered a rebuild of every file that includes application.h.

Move all build_info_data.h dependent code from application.h inline
methods to application.cpp, so only application.cpp recompiles when
build info changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-23 13:43:10 -05:00
J. Nick Koston
e199145f1c [core] Avoid expensive modulo in LockFreeQueue for non-power-of-2 sizes (#14221) 2026-02-23 12:20:55 -06:00
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 Koston
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 Koston
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 Koston
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
Joshua Sing
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 Koston
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 Swoboda
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