Commit Graph
25307 Commits
Author SHA1 Message Date
J. Nick Koston 74facf69a1 Merge remote-tracking branch 'upstream/fix-rp2040-wifi-validation' into integration 2026-03-19 16:03:30 -10:00
J. Nick Koston ec70166ad2 [wifi] Reject WiFi config on RP2040/RP2350 boards without CYW43 chip
Boards like rpipico2 (Raspberry Pi Pico 2) don't have WiFi hardware
but ESPHome allowed configuring wifi on them, leading to linker errors
from missing CYW43 driver symbols. Add validation to catch this at
config time with a clear error message.

- Add wifi detection to the board generator by checking for
  PICO_CYW43_SUPPORTED=1 in upstream extra_flags
- Add validation in wifi component to reject non-WiFi RP2040 boards

Closes https://github.com/esphome/esphome/issues/14989
2026-03-19 16:01:02 -10:00
J. Nick Koston d53fb75b98 Merge remote-tracking branch 'origin/splitmix32-random' into integration 2026-03-19 14:45:46 -10:00
J. Nick Koston d161757588 turns out random_bytes was broken on nrf52 2026-03-19 14:26:08 -10:00
J. Nick Koston 8e6bc37785 Ensure non-zero seed after random_bytes() 2026-03-19 13:41:04 -10:00
J. Nick Koston e91e1edbe8 Merge remote-tracking branch 'origin/fix-memory-impact-platform-filter' into integration 2026-03-19 13:38:59 -10:00
J. Nick Koston bcc0180cd2 Merge remote-tracking branch 'upstream/splitmix32-random' into integration 2026-03-19 13:38:46 -10:00
J. Nick Koston e2a59daabc Add SplitMix32 references for reviewers 2026-03-19 13:37:26 -10:00
J. Nick Koston 2af50329f4 Document design trade-off for state==0 reseed 2026-03-19 13:36:08 -10:00
J. Nick Koston 1b090e6b95 Address review: use 'secure RNG' instead of 'hardware RNG' in comments 2026-03-19 13:35:43 -10:00
J. Nick Koston b5a1faac68 [ci] Add libretiny and zephyr to memory impact platform filter
Add libretiny and zephyr to PLATFORM_SPECIFIC_COMPONENTS so they
are correctly filtered out when an incompatible platform is selected
for memory impact analysis. Previously, libretiny was missing from
the set, causing it to be included in esp32-idf builds and producing
a misleading comment showing both platforms.
2026-03-19 13:32:40 -10:00
J. Nick Koston f02bf07630 [core] Use SplitMix32 PRNG for random_uint32() across platforms
Replace platform-specific random_uint32() implementations with a
unified SplitMix32 PRNG seeded from random_bytes(). This provides
consistent, fast, non-cryptographic random numbers on all platforms.

ESP8266 retains os_random() as it is already faster on that platform.

Benchmarked on real hardware (ns/call, before -> after):
- RP2040: 2815 -> 333 (8.5x faster)
- ESP32: 871 -> 354 (2.5x faster)
- BK72xx: 1073 -> 882 (1.2x faster, replaces weak rand())
- RTL87xx: 330 -> 283 (1.2x faster, replaces weak rand())
- ESP8266: 763 (unchanged, keeps os_random())

random_bytes() remains platform-specific hardware RNG for crypto use.
2026-03-19 13:17:24 -10:00
J. Nick Koston 8a28e40a9e Merge remote-tracking branch 'upstream/api-dump-progmem' into integration 2026-03-19 12:41:04 -10:00
J. Nick Koston 78b10a24b0 Move message_name() strings to flash via LOG_STR
message_name() returned bare string literals that stayed in RAM on
ESP8266. Change return type to const LogString * and wrap with LOG_STR()
so they are stored in flash. Update log_send_message_ to use
LOG_STR_ARG() accordingly.

Also fix clang-tidy: rename append_p_esp8266_ to append_p_esp8266,
add NOLINTNEXTLINE for conditionally-unused dump_field overloads.
2026-03-19 12:40:38 -10:00
J. Nick Koston 68340875dd Merge remote-tracking branch 'origin/api-dump-progmem' into integration 2026-03-19 12:38:52 -10:00
J. Nick Koston fb07c708b5 Move message_name() strings to flash via LOG_STR
message_name() returned bare string literals that stayed in RAM on
ESP8266. Change return type to const LogString * and wrap with LOG_STR()
so they are stored in flash. Update log_send_message_ to use
LOG_STR_ARG() accordingly.

Also fix clang-tidy: rename append_p_esp8266_ to append_p_esp8266,
add NOLINTNEXTLINE for conditionally-unused dump_field overloads.
2026-03-19 12:35:29 -10:00
J. Nick Koston 96616e3ccb Merge remote-tracking branch 'upstream/ci-ban-std-bind' into integration 2026-03-19 12:30:24 -10:00
J. Nick Koston 360207ca60 Merge remote-tracking branch 'upstream/api-dump-progmem' into integration 2026-03-19 12:30:22 -10:00
J. Nick Koston a79bb7f0fc Merge remote-tracking branch 'upstream/fix-mhz19-unused-warning' into integration 2026-03-19 12:30:07 -10:00
J. Nick Koston ad0c5cf5fa Merge remote-tracking branch 'upstream/esp32-sram1-as-iram' into integration 2026-03-19 12:30:01 -10:00
J. Nick Koston 5e64e3a3d4 [api] Store dump strings in PROGMEM to save RAM on ESP8266
All string literals in api_pb2_dump.cpp (field names, message names,
enum value names) were stored in rodata which occupies RAM on ESP8266.
This meant every API protobuf change appeared as a RAM increase in CI
when using very_verbose logging.

Add append_p() to DumpBuffer for PROGMEM-safe string reading and update
the code generator to wrap all dump string literals with ESPHOME_PSTR().
On non-ESP8266 platforms, these are no-ops with zero overhead.
2026-03-19 12:24:10 -10:00
dependabot[bot] c2a96ea293 Bump ruff from 0.15.6 to 0.15.7 (#14977)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-19 10:54:53 -10:00
J. Nick Koston 29ba96e5b2 Merge remote-tracking branch 'upstream/fix-logger-init-order-14970' into integration 2026-03-19 10:37:59 -10:00
J. Nick Koston 09d8e38438 [logger] Move set_log_level to early init phase
Ensures initial log level filtering is active before platform
code runs, preventing VV spam when initial_level < VERY_VERBOSE.
2026-03-19 10:37:16 -10:00
J. Nick Koston b8ac58e06e Merge remote-tracking branch 'upstream/fix-logger-init-order-14970' into integration 2026-03-19 10:34:27 -10:00
J. Nick Koston 78c11e4cbc [core] Rename LOGGER_INIT to EARLY_INIT
Better reflects the purpose: pre-Application init phase
where only logging setup belongs currently.
2026-03-19 10:32:17 -10:00
J. Nick Koston 41119aef8c Merge branch 'fix-logger-init-order-14970' into integration 2026-03-19 10:31:01 -10:00
J. Nick Koston fd90f66f0e [logger] Split early init from component registration
Move only pre_setup() to LOGGER_INIT priority. Defer
register_component and remaining setup to DIAGNOSTICS
so that Application is constructed first.
2026-03-19 10:30:41 -10:00
J. Nick Koston 0473280ff6 Merge remote-tracking branch 'upstream/fix-logger-init-order-14970' into integration 2026-03-19 10:26:33 -10:00
J. Nick Koston 84b9c9fb69 [mhz19] Fix unused function warning for detection_range_to_log_string
Guard detection_range_to_log_string() with #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG
so it is compiled out when the log level is below DEBUG, matching its callers
(ESP_LOGD and ESP_LOGCONFIG) which are also compiled out at that level.

Fixes https://github.com/esphome/esphome/issues/14975
2026-03-19 10:26:21 -10:00
J. Nick Koston 1ee478c419 [logger] Fix ESP8266 crash with VERY_VERBOSE log level
Move logger codegen priority above platform init so that
global_logger is set before setup_preferences() or any other
platform code that may contain ESP_LOG* calls.

Previously the logger initialized at DIAGNOSTICS priority (90),
which ran after PLATFORM (1000). With VERY_VERBOSE, the
ESP_LOGVV in ESP8266Preferences::setup() fired before
global_logger was set, causing a nullptr dereference crash.

Also hardcode `using namespace esphome;` in writer.py so it
precedes all variable declarations regardless of codegen
priority ordering.

Fixes #14970
2026-03-19 10:19:19 -10:00
J. Nick Koston a048a30019 Merge remote-tracking branch 'upstream/dev' into esp32-sram1-as-iram
# Conflicts:
#	esphome/components/esp32/__init__.py
2026-03-19 10:00:37 -10:00
J. Nick Koston 01b32124ad Merge remote-tracking branch 'upstream/fix-uart0-iomux-loopback' into integration 2026-03-19 09:56:59 -10:00
J. Nick Koston 7f6aa47434 [uart] Fix UART0 default pin IOMUX loopback on ESP32
Clear residual IOMUX function on UART0 default pins before calling
uart_set_pin(). The ROM bootloader configures these pins via IOMUX
for console output. ESP-IDF's uart_set_pin() has an asymmetry: when
routing TX via GPIO matrix it calls gpio_func_sel(PIN_FUNC_GPIO) to
clear IOMUX, but for RX it only calls gpio_input_enable() which does
NOT clear the IOMUX function select.

If a default UART0 TX pin is later reassigned as RX via GPIO matrix
(common on ESP32-C3 where users swap GPIO20/GPIO21), the old IOMUX TX
function remains active, causing transmitted data to loop back into RX.

This is a targeted fix using gpio_func_sel() which only writes the
IO MUX function register - unlike the previous gpio_reset_pin()
approach which also changed direction, pulls, and drive strength,
breaking external components that rely on default pin state (#11823).

Fixes #14973
Fixes #14612
2026-03-19 09:28:08 -10:00
J. Nick Koston ad024bcbcd Merge branch 'dev' into ci-ban-std-bind 2026-03-19 08:50:53 -10:00
J. Nick Koston 37a3c3ab3a [core] Replace std::bind with placeholders to lambdas (#14962) 2026-03-19 08:50:38 -10:00
J. Nick Koston a8ed781f3e [time] Fix lookup of top-level IANA timezone keys like UTC and GMT (#14952) 2026-03-19 08:44:35 -10:00
J. Nick Koston 63f0d054b7 [core] Replace std::bind with lambda in DelayAction (#14968) 2026-03-19 08:44:16 -10:00
J. Nick Koston e7dcf54a77 [http_request] Replace std::bind with lambdas in HttpRequestSendAction (#14966) 2026-03-19 08:44:02 -10:00
J. Nick Koston 1ba5504944 [mqtt] Replace std::bind with lambda in MQTTPublishJsonAction (#14965) 2026-03-19 08:43:47 -10:00
J. Nick Koston 5637116378 [mqtt] Replace std::bind with lambdas in CustomMQTTDevice (#14964) 2026-03-19 08:43:22 -10:00
J. Nick Koston cdc4ba6295 [api] Replace std::bind with lambdas in CustomAPIDevice (#14963) 2026-03-19 08:43:06 -10:00
J. Nick Koston d1aa1881bb [core] Replace std::bind with lambdas across 13 components (#14961) 2026-03-19 08:42:26 -10:00
14107ec452 [bme68x_bsec2] Store trigger time as member to avoid std::function SBO overflow (#14960)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-19 08:42:08 -10:00
J. Nick Koston 2ca6681896 [xiaomi_rtcgq02lm] Drop unused capture from timeout lambdas (#14959) 2026-03-19 08:41:15 -10:00
J. Nick Koston 40a65d36b4 [nau7802] Replace std::bind with lambda to fit std::function SBO (#14958) 2026-03-19 08:41:01 -10:00
J. Nick Koston 16ec237ac6 [wireguard] Replace std::bind with inline lambdas (#14957) 2026-03-19 08:40:32 -10:00
J. Nick Koston 0afcdbfe73 [binary_sensor] Replace std::bind with inline lambda in MultiClickTrigger (#14956) 2026-03-19 08:40:18 -10:00
b9439036d4 [remote_base] add support for brennenstuhl comfort-line switches (#9407)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-19 09:19:24 -04:00
CFlixandDAVe3283 cb23f9453f [absolute_humidity] loop() improvement (#14684)
Co-authored-by: DAVe3283 <DAVe3283+GitHub@gmail.com>
2026-03-19 09:09:00 -04:00