Commit Graph
24095 Commits
Author SHA1 Message Date
J. Nick Koston 8429018261 Merge remote-tracking branch 'origin/integration' into integration 2026-03-06 08:48:14 -10:00
J. Nick Koston 379e0b060f Merge branch 'configure_entity' into integration
# Conflicts:
#	esphome/components/api/api_connection.cpp
#	esphome/components/api/api_connection.h
#	esphome/core/application.h
#	esphome/core/config.py
#	esphome/core/entity_base.h
2026-03-06 08:47:29 -10:00
J. Nick Koston 3c6de6d691 Merge branch 'configure_entity' into integration
# Conflicts:
#	esphome/components/api/api_connection.cpp
#	esphome/components/api/api_connection.h
#	esphome/core/application.h
#	esphome/core/config.py
#	esphome/core/entity_base.h
2026-03-06 08:43:19 -10:00
J. Nick Koston fd19bb4aa3 Merge remote-tracking branch 'upstream/dev' into configure_entity
# Conflicts:
#	esphome/core/entity_base.h
2026-03-06 08:40:31 -10:00
J. Nick KostonandCopilot 8a915dcbbe [core] Move device class strings to PROGMEM on ESP8266 (#14443)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-06 08:34:27 -10:00
b2378e830e [rtttl] Add AudioStreamInfo and set volume (#14439)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-06 18:11:52 +00:00
J. Nick KostonandClaude Opus 4.6 65b7c73bf3 [sgp4x] Fix undefined behavior from mutating entity config at runtime (#14562)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 18:02:34 +00:00
J. Nick Koston 6b53ccc85a make it safer 2026-03-06 07:39:49 -10:00
J. Nick Koston 79d7795c07 Merge branch 'dev' into configure_entity 2026-03-06 07:33:40 -10:00
J. Nick Koston 6e3bc7b1dd [ci] Use pull_request_target for codeowner approved label workflow (#14561) 2026-03-06 07:33:05 -10:00
J. Nick Koston 82629c397f [hlk_fm22x] Fix oversized response rejection breaking GET_ALL_FACE_IDS (#14506) 2026-03-06 07:01:50 -10:00
J. Nick Koston a16b8fc0ac [rp2040] Fix Pico W LED pin and auto-generate board definitions for arduino-pico 5.5.x (#14528) 2026-03-06 07:00:31 -10:00
J. Nick KostonandCopilot 74e4b69654 [core] Replace Application name/friendly_name std::string with StringRef (#14532)
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-03-06 06:58:13 -10:00
J. Nick Koston 07e51886f3 [core] Move entity icon strings to PROGMEM on ESP8266 (#14437) 2026-03-06 06:57:52 -10:00
tomaszduda23andJonathan Swoboda e59a2b3ede [nrf52] prepare for usb cdc (#14174)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-06 16:25:44 +00:00
Thomas Rupprecht 5084c32f3c [esp32] Fix ESP32-S3 pin validation error message (#14540) 2026-03-06 07:22:11 -05:00
Thomas Rupprecht c0b7f41397 [esp32] Fix wrong variable usage in P4 pin validation error msg (#14539) 2026-03-06 07:21:44 -05:00
Jonathan SwobodaandClaude Opus 4.6 6c07c15c50 [mipi_dsi][e131] Fix semaphore cast, missing return, and light count overread (#14530)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 07:18:56 -05:00
Jonathan SwobodaandClaude Opus 4.6 666fb7cf39 [sx127x][sx126x][max6956] Fix null deref, unterminated string, and pin bounds check (#14529)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 07:18:28 -05:00
J. Nick Koston 040e844061 Merge remote-tracking branch 'origin/devirtualize-proto-encode' into integration 2026-03-05 22:24:10 -10:00
J. Nick Koston 1507b4d6bc Merge remote-tracking branch 'upstream/devirtualize-proto-encode' into integration 2026-03-05 22:21:32 -10:00
J. Nick Koston 0825c763fb Merge branch 'move_device_class_progmem' into devirtualize-proto-encode 2026-03-05 22:19:57 -10:00
J. Nick Koston 6abdb16b41 merge 2026-03-05 22:16:42 -10:00
J. Nick Koston beb075db9a Merge branch 'move_icons_progmem' into move_device_class_progmem 2026-03-05 22:16:15 -10:00
J. Nick Koston b0d3be6b4a Merge branch 'dev' into move_icons_progmem 2026-03-05 22:16:06 -10:00
J. Nick Koston 191e5d70b5 Merge origin/log-skip-vprintf-indirection into integration 2026-03-05 22:12:26 -10:00
J. Nick Koston 1fa99305f9 [log] Enable ESPHOME_DEBUG in integration tests 2026-03-05 22:05:36 -10:00
J. Nick Koston 6e36af6c4b [log] Add ESPHOME_DEBUG_ASSERT for log function invariants
Add ESPHOME_DEBUG_ASSERT macro that only fires when ESPHOME_DEBUG is
defined. Use it to assert global_logger is not null in log functions.
Enable ESPHOME_DEBUG in C++ unit test builds so these assertions are
active during testing but have zero cost in production firmware.
2026-03-05 22:05:17 -10:00
J. Nick Koston d8600b5bc9 [log] Add missing USE_LOGGER guard on FlashStringHelper overload 2026-03-05 22:02:13 -10:00
J. Nick Koston 92a37d4cb0 [log] Initialize Logger in C++ test framework
Log functions call global_logger->log_vprintf_() without a null check.
The test main.cpp skips the generated setup() (which calls
Logger::pre_setup()), so set up a static Logger before running tests.
2026-03-05 22:00:06 -10:00
J. Nick Koston 8d36935083 [log] Strengthen comment about no null checks on hot path 2026-03-05 21:49:26 -10:00
J. Nick Koston 8a2514a9c9 [log] Remove null check indirection from log functions
Call global_logger->log_vprintf_() directly without null-checking
global_logger on every log call. Logger::pre_setup() sets global_logger
before any other component is created in the generated setup() function,
so it is guaranteed to be valid by the time any log function is invoked.

Also removes the __FlashStringHelper* esp_log_vprintf_ overload which
was dead code (only called from esp_log_printf_, never directly).

Add a Python codegen test to verify the ordering invariant, and a
comment on App.pre_setup() documenting the constraint.
2026-03-05 21:47:25 -10:00
J. Nick Koston 4b500d05ed Merge branch 'log-skip-vprintf-indirection' into integration
# Conflicts:
#	esphome/components/bluetooth_proxy/bluetooth_connection.cpp
2026-03-05 21:31:57 -10:00
J. Nick Koston a4919f2504 [log] Skip esp_log_vprintf_ indirection on non-flash platforms
On platforms without USE_STORE_LOG_STR_IN_FLASH (ESP32, RP2040,
LibreTiny), there is only one esp_log_printf_ overload, so the
separate esp_log_vprintf_ function just adds an unnecessary call
frame. Inline the logger dispatch directly into esp_log_printf_
for these platforms.

The const char* esp_log_vprintf_ is still provided unconditionally
for direct callers (e.g. midea component).

On ESP8266 (USE_STORE_LOG_STR_IN_FLASH), the two esp_log_printf_
overloads continue to share esp_log_vprintf_ as before.

Measured: 32 bytes flash saved on ESP32, no change on ESP8266.
2026-03-05 21:22:14 -10:00
a2c0d70c2c [ble_nus] Add uart support (#14320)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-03-05 21:00:17 -10:00
J. Nick Koston e4082f7a00 Merge branch 'app-name-stringref' of https://github.com/esphome/esphome into integration 2026-03-05 20:59:40 -10:00
Jonathan SwobodaandClaude Opus 4.6 80fe54ed69 [bluetooth_proxy] Add null checks for api_connection (#14536)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 23:30:39 -05:00
Copilot e10d6c2da7 Fix clang-tidy error in dummy_main.cpp for updated pre_setup signature (#14535) 2026-03-05 18:14:14 -10:00
J. Nick Koston e5b75b071a Merge remote-tracking branch 'origin/app-name-stringref' into integration 2026-03-05 16:09:31 -10:00
J. Nick Koston 21770f920f Reject empty hostname in validate_hostname
Empty name would cause memcpy underflow in the MAC suffix path.
While unlikely in practice, validate explicitly to be safe.
2026-03-05 16:04:38 -10:00
J. Nick Koston 65b8f6470b Merge branch 'dev' into app-name-stringref 2026-03-05 16:03:55 -10:00
Jonathan SwobodaandClaude Opus 4.6 44870323da [host] Add null checks for getenv and fopen in preferences (#14531)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 20:47:47 -05:00
J. Nick Koston dedabba199 Merge branch 'app-name-stringref' into integration
# Conflicts:
#	esphome/core/application.h
2026-03-05 15:46:47 -10:00
J. Nick Koston 8a6a7e0eeb Add comment noting name is always non-empty in MAC suffix path 2026-03-05 15:42:53 -10:00
J. Nick Koston 363086b4f1 Extract make_app_name_cpp as testable free function with unit tests
Move the pure logic (string building, escaping, byte length
calculation) out of the nested closure into a module-level function
that can be tested without codegen mocks. Tests cover both copilot
review concerns: empty friendly_name with MAC suffix, and UTF-8
byte length for non-ASCII characters.
2026-03-05 15:35:31 -10:00
J. Nick Koston 3d9ed604a0 Fix empty friendly_name with MAC suffix and use UTF-8 byte lengths
When name_add_mac_suffix is true and friendly_name is empty, emit a
mutable static char[] buffer instead of a string literal to match the
char* signature. Also use UTF-8 byte lengths instead of Python str
len() to handle non-ASCII characters correctly.
2026-03-05 15:32:14 -10:00
J. Nick Koston 0f10a13631 Use ifdef to split pre_setup signatures for const correctness
When MAC suffix is not used, pre_setup takes const char* parameters
so string literals stay in flash. When MAC suffix is used, it takes
mutable char* for the static buffers that get overwritten with the
actual MAC address. This avoids const_cast entirely.

Also adds ESPHOME_NAME_ADD_MAC_SUFFIX define for static analysis.
2026-03-05 15:20:20 -10:00
J. Nick Koston 2b799b1ede Use auto for App.get_name()/get_friendly_name() bindings 2026-03-05 15:13:13 -10:00
J. Nick Koston 2b2c42eff5 [core] Replace Application name/friendly_name with StringRef
Replace std::string members with StringRef for Application::name_
and Application::friendly_name_. These are set once during setup()
and never modified, so std::string overhead is unnecessary.

For the MAC suffix case, codegen emits static mutable char buffers
with a placeholder suffix that pre_setup() overwrites with the
actual MAC address. For the non-suffix case, StringRef points
directly at the string literal.

Saves ~2.5KB flash and ~48 bytes RAM by eliminating std::string
template instantiations (constructor, _M_assign, _M_dispose,
_M_construct, _M_replace_cold, _S_copy).
2026-03-05 15:12:09 -10:00
J. Nick Koston 0596980326 Merge branch 'rp2040-auto-gen-boards' into integration 2026-03-05 14:43:00 -10:00