Commit Graph

23124 Commits

Author SHA1 Message Date
J. Nick Koston
8b2fc9660c Merge branch 'version-cpp17-namespace' into integration 2026-02-23 18:20:51 -06:00
J. Nick Koston
249b0555a9 [version] Use C++17 nested namespace syntax 2026-02-23 18:20:08 -06:00
J. Nick Koston
1fd75a9abf Merge branch 'light-fast-lerp' into integration 2026-02-23 17:40:17 -06:00
J. Nick Koston
3d036d941e [light] Replace std::lerp with lightweight lerp_fast in LightColorValues::lerp
std::lerp includes NaN/infinity edge-case handling per C++20 spec which
adds ~200 bytes of overhead per call. With 10 fields interpolated, this
bloated the symbol to 2,038 bytes on BK72xx. Since all light color values
are pre-clamped finite floats, a simple a + t * (b - a) is sufficient.

Reduces LightColorValues::lerp from 2,038 B to 286 B on BK72xx.
Also saves 16 bytes on ESP8266.
2026-02-23 17:37:37 -06:00
J. Nick Koston
7f6bb6a8ac Merge remote-tracking branch 'origin/light-fast-lerp' into integration 2026-02-23 17:23:50 -06:00
J. Nick Koston
8db3f67be4 [light] Replace std::lerp with lightweight fast_lerp in LightColorValues::lerp
std::lerp includes NaN/infinity edge-case handling per C++20 spec, which
generates ~200 bytes of overhead per call. With 10 fields interpolated,
this bloated the symbol to 2,038 bytes. Since all light color values are
pre-clamped finite floats, a simple a + t * (b - a) is sufficient.

Reduces LightColorValues::lerp from 2,038 B to 286 B (86% reduction).
2026-02-23 17:22:21 -06:00
J. Nick Koston
eefff2ff32 Merge branch 'posix_tz_avoid_linking_scanf' into integration 2026-02-23 17:09:06 -06:00
J. Nick Koston
869678953d [core] Add pow10_int helper, replace powf in normalize_accuracy and sensor filters (#14114)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:03:24 +13:00
J. Nick Koston
fb9f45a994 Merge branch 'remove_posix_tz_parser' into integration 2026-02-23 16:52:03 -06:00
J. Nick Koston
0aa43b0c4f tweak 2026-02-23 16:51:46 -06:00
J. Nick Koston
28c6fbdc9e [api] Mark timezone string field as deprecated in GetTimeResponse
parsed_timezone struct should be used instead. The string field will be
removed before 2027.1.0.
2026-02-23 16:50:53 -06:00
J. Nick Koston
b4817c424d [api] Skip timezone update when parsed struct is not populated
Old clients (before 2026.3.0) send only the timezone string without the
parsed_timezone struct, so all fields default to zero. Without this check,
the device would overwrite its codegen-configured timezone with UTC.

Keep the codegen timezone when the struct is unpopulated (all zeros).
For actual UTC this also skips, which is harmless since UTC is the default.
2026-02-23 16:49:29 -06:00
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