Commit Graph

23471 Commits

Author SHA1 Message Date
J. Nick Koston
9bbec40242 Merge remote-tracking branch 'origin/web_server' into integration 2026-02-27 16:02:33 -10:00
J. Nick Koston
41dac179ca Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-02-27 16:02:21 -10:00
J. Nick Koston
42de1ca17f Merge branch 'fix-sen6x-test-id-collisions' into pack-entity-strings 2026-02-27 15:48:43 -10:00
J. Nick Koston
ff7dcae4a0 [sen6x] Fix test sensor ID collisions with sen5x
The sen6x test YAML used identical sensor IDs (pm_1_0, pm_2_5,
pm_4_0, pm_10_0) as sen5x, causing ID redefinition errors when
both components are tested together in grouped builds. Prefix
the sen6x IDs with sen6x_ to make them unique.
2026-02-27 15:47:29 -10:00
J. Nick Koston
3a31058f62 [water_heater] Use length-aware comparisons in set_mode(const char*, size_t)
Make set_mode(const char*, size_t) the real implementation using
ESPHOME_strncasecmp_P with length checks, instead of ignoring len
and delegating to the null-terminated overload.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:37:36 -10:00
J. Nick Koston
26b867477d [api] Use const char* overloads for text and alarm_control_panel commands
Avoid implicit StringRef->std::string conversion when the protobuf
message fields are already StringRef. Use the (const char*, size_t)
overloads directly.
2026-02-27 15:34:41 -10:00
J. Nick Koston
5330445a4d preen 2026-02-27 15:17:01 -10:00
J. Nick Koston
949143626a preen 2026-02-27 15:16:03 -10:00
J. Nick Koston
eb2a8aacde Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-02-27 15:04:00 -10:00
J. Nick Koston
f0eafd553d Merge remote-tracking branch 'upstream/dev' into pack-entity-strings
# Conflicts:
#	esphome/components/rp2040/core.cpp
2026-02-27 14:54:37 -10:00
J. Nick Koston
5ad9c9869f Merge branch 'dev' of https://github.com/esphome/esphome into integration 2026-02-27 14:49:11 -10:00
Ryan Wagoner
d1b4813197 [web_server] Add climate preset, fan mode, and humidity support (#14061) 2026-02-27 14:20:13 -10:00
Jonathan Swoboda
298ee7b92e [gps] Fix codegen deadlock when automations reference sibling sensors (#14365)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 19:08:42 -05:00
J. Nick Koston
c37d02e2e5 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 14:00:10 -10:00
J. Nick Koston
f861bf9564 Merge branch 'fix-uart-default-pin-pullup-removal' into integration 2026-02-27 14:00:03 -10:00
J. Nick Koston
0efa547143 Revert "[uart] Fix UART on default UART0 pins for ESP-IDF (#12519)"
This reverts commit 1897551b28.
2026-02-27 13:34:12 -10:00
J. Nick Koston
5a00455b34 Revert "[uart] Always call pin setup for UART0 default pins on ESP-IDF (#14130)"
This reverts commit 7bdeb32a8a.
2026-02-27 13:34:12 -10:00
J. Nick Koston
5c56b99742 [ci] Fix C++ unit tests missing time component dependency (#14364) 2026-02-27 13:19:11 -10:00
J. Nick Koston
90cfe40f91 Merge remote-tracking branch 'upstream/wrap-printf-stubs' into integration 2026-02-27 13:04:00 -10:00
J. Nick Koston
6c3746cad0 Fix clang-tidy naming: remove trailing underscore from static function
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:01:17 -10:00
J. Nick Koston
b840dfb7e5 Merge branch 'wrap-printf-stubs' into integration 2026-02-27 12:53:21 -10:00
J. Nick Koston
0e14d0b0a0 Fix config path in comments: esp32 framework advanced 2026-02-27 12:47:08 -10:00
J. Nick Koston
35ac7a16f9 Use tuple instead of list for static iteration 2026-02-27 12:46:51 -10:00
J. Nick Koston
8dd24bfe78 Note that crash backtraces use esp_rom_printf, not libc 2026-02-27 12:46:04 -10:00
J. Nick Koston
2f903c91ff Clarify that stubs are dead code at runtime and overflow is defensive 2026-02-27 12:45:00 -10:00
J. Nick Koston
b2728cbd44 Address review: flush before abort, check fwrite errors, add test 2026-02-27 12:43:22 -10:00
J. Nick Koston
a3a6ed3582 Extract common buffer write + overflow check into helper 2026-02-27 12:40:58 -10:00
J. Nick Koston
9f11dc736f Add namespace esphome::esp32 to satisfy CI lint check 2026-02-27 12:39:30 -10:00
J. Nick Koston
af1a00ccf9 [esp32] Wrap printf/vprintf/fprintf to eliminate _vfprintf_r (~11 KB flash)
ESP-IDF SDK components reference fprintf(), printf(), and vprintf()
which pull in newlib's _vfprintf_r (~11 KB). This is a separate
implementation from _svfprintf_r (used by snprintf/vsnprintf) that
handles FILE* stream I/O with buffering and locking.

ESPHome replaces the ESP-IDF log handler via esp_log_set_vprintf_(),
so the SDK's vprintf() path is dead code at runtime. The fprintf()
and printf() calls in SDK components are only in debug/assert paths
that are either GC'd or never called.

These linker --wrap stubs redirect through vsnprintf() + fwrite(),
allowing the linker to dead-code eliminate _vfprintf_r.

An escape hatch is provided via enable_full_printf: true in the
esp32 advanced config section for external components that need
full FILE*-based fprintf.
2026-02-27 12:35:41 -10:00
J. Nick Koston
8c70472f60 Merge remote-tracking branch 'upstream/dev' into integration 2026-02-27 11:50:44 -10:00
Martin Ebner
b9d70dcda2 [sen6x] Add SEN6x sensor support (#12553)
Co-authored-by: Martin Ebner <martinebner@me.com>
Co-authored-by: Tobias Stanzel <tobi.stanzel@gmail.com>
Co-authored-by: Big Mike <mike@bigmike.land>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 16:41:28 -05:00
J. Nick Koston
32794b9fc0 Merge remote-tracking branch 'upstream/move-millis64-impl' into integration 2026-02-27 11:41:19 -10:00
J. Nick Koston
9b3800c867 Guard TAG, log.h, and cinttypes behind ESPHOME_DEBUG_SCHEDULER
These are only used in debug rollover logging. Guarding them avoids
unused variable warnings and unnecessary includes in normal builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:39:34 -10:00
dependabot[bot]
5e3857abf7 Bump click from 8.1.7 to 8.3.1 (#11955)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-27 16:25:36 -05:00
Laura Wratten
bb567827a1 [sht3xd] Allow sensors that don't support serial number read (#14224)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-02-27 16:23:32 -05:00
J. Nick Koston
f9d6df5403 Merge remote-tracking branch 'upstream/dev' into move-millis64-impl
# Conflicts:
#	esphome/core/scheduler.cpp
#	esphome/core/scheduler.h
2026-02-27 11:20:56 -10:00
J. Nick Koston
280f874edc [rp2040] Use native time_us_64() for millis_64() (#14356)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:18:02 -10:00
J. Nick Koston
c9a2fe5b80 Move HALF_MAX_UINT32 inside compute() function
Only used within the function, matches the pattern of ROLLOVER_WINDOW.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:04:46 -10:00
J. Nick Koston
3d674ae1d2 Restructure preprocessor guards to single if/elif/else chain
Pure code reorganization — no functional change. Combines the separate
#ifndef ESPHOME_THREAD_SINGLE and #ifdef ESPHOME_THREAD_MULTI_ATOMICS
guards into one if/elif/else chain so each threading model's static
variables are grouped together.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:02:37 -10:00
J. Nick Koston
ec2259733e Revert spinlock back to Mutex for atomics path
A std::atomic_flag spinlock is unsafe on preemptive single-core RTOS
platforms (like LN882H) due to priority inversion: a high-priority task
spinning would prevent the lock holder from running to release it.
FreeRTOS Mutex has priority inheritance to handle this correctly.

Added a comment explaining why spinlock can't be used here.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 11:01:06 -10:00
J. Nick Koston
c121d8dc2a Move millis_64() call inside non-defer path
defer() items go straight into defer_queue_ and never use a timestamp.
Now that millis_64() has its own lock separate from the scheduler,
the call no longer needs to happen before taking the scheduler lock.
Move it inside the non-defer branch so defer() avoids the cost entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:56:29 -10:00
J. Nick Koston
6c8542026f Replace Mutex with atomic_flag spinlock for MULTI_ATOMICS path
The atomics path only takes the lock during rollover (every ~49.7 days)
for a ~5 instruction critical section. A std::atomic_flag spinlock
(1 byte) replaces the full FreeRTOS Mutex (~80-100 bytes RAM) since
contention is near-zero. The full Mutex is kept only for the
MULTI_NO_ATOMICS path (BK72xx) which needs it for broader locking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:51:40 -10:00
J. Nick Koston
c3252e861f Don't allocate Mutex on single-threaded platforms
On ESPHOME_THREAD_SINGLE (ESP8266), the lock is never used.
Guarding it avoids the static local guard variable overhead
(8 bytes RAM + init check on every call).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:39:53 -10:00
J. Nick Koston
ea47af1fe3 Use cg.add_define for USE_NATIVE_64BIT_TIME
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:36:04 -10:00
J. Nick Koston
fedf9d0ad5 [core] Move millis_64 rollover tracking out of Scheduler into time_64.cpp
millis_64_impl_() handles 32-bit millis() rollover tracking for
platforms without native 64-bit time (ESP8266, LibreTiny). It was a
Scheduler method using Scheduler fields (last_millis_, millis_major_,
lock_), but has nothing to do with scheduling.

Move it to esphome/core/time_64.cpp as Millis64Impl::compute() with
static local state. Access is restricted via friend to millis_64()
(HAL) and Scheduler only.

Also introduces USE_NATIVE_64BIT_TIME define emitted by ESP32, Host,
Zephyr, and RP2040 platforms, replacing the verbose multi-platform
#if guards throughout scheduler.h/cpp.

time_64.cpp is only compiled on platforms that need it (ESP8266,
LibreTiny) via the build filter in config.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:32:06 -10:00
Jonathan Swoboda
f6755aabae [ci] Add PR title format check (#14345)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-27 15:18:07 -05:00
J. Nick Koston
8588063f65 fix stale comment 2026-02-27 10:12:09 -10:00
J. Nick Koston
d1de36840c Merge remote-tracking branch 'upstream/dev' into millis64-rp2040-native
# Conflicts:
#	esphome/core/scheduler.cpp
#	esphome/core/scheduler.h
2026-02-27 10:03:53 -10:00
J. Nick Koston
52af4bced0 [component] Devirtualize call_dump_config (#14355) 2026-02-27 10:01:23 -10:00
J. Nick Koston
63e757807e [zephyr] Use native k_uptime_get() for millis_64() (#14350)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 10:01:09 -10:00