Commit Graph
24060 Commits
Author SHA1 Message Date
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
J. Nick Koston 6febef0660 Add explicit encoding='utf-8' to read_text and write_text 2026-03-05 14:39:12 -10:00
J. Nick Koston 46d325065f Filter out placeholder pin values (e.g. 99) during board generation 2026-03-05 14:31:08 -10:00
J. Nick Koston b4c121fecf Merge branch 'rp2040-auto-gen-boards' into integration 2026-03-05 14:14:16 -10:00
J. Nick Koston 3bebe728e4 Merge remote-tracking branch 'origin/rp2040-upload-improvements' into integration 2026-03-05 14:14:10 -10:00
J. Nick Koston 59b40de97a silence warnings from code we do not control 2026-03-05 14:13:52 -10:00
J. Nick Koston 0d124208e1 Fix pylint unspecified-encoding in _get_variant 2026-03-05 14:12:03 -10:00
J. Nick Koston b4ed8e036a Move Jinja2 template to separate boards.jinja2 file 2026-03-05 14:03:54 -10:00
J. Nick Koston e560594202 template 2026-03-05 14:03:33 -10:00
J. Nick Koston 424d4193b2 Fix pylint unspecified-encoding warnings in generate_boards.py 2026-03-05 13:57:40 -10:00
J. Nick Koston e103ca20ba [rp2040] Auto-generate boards.py from arduino-pico, fix Pico W LED pin
Add generate_boards.py script that reads board definitions and variant
pin headers from the arduino-pico repository to auto-generate boards.py
with support for 143+ boards including RP2350 variants.

Fix the Pico W LED pin from 32 (non-existent GPIO, never worked) to 64
(CYW43 wireless GPIO 0, hardware verified).

Make gpio.py pin validation data-driven:
- CYW43 virtual pin detection uses board pin map data
- Pin range based on MCU type from generated board metadata
- No hardcoded board names or magic numbers
2026-03-05 13:51:43 -10:00
Gnuspice 58ab630965 [ethernet] add get_eth_handle() function (#14527) 2026-03-05 23:37:07 +00:00
J. Nick Koston aba845691f Fix picotool tests on Windows
Use platform-appropriate binary name (picotool.exe on Windows)
when creating mock picotool files in tests.
2026-03-05 13:31:47 -10:00
J. Nick Koston 4780bd343c Merge remote-tracking branch 'origin/rp2040-socket-wake' into integration 2026-03-05 13:21:43 -10:00
J. Nick Koston 868357fab8 Merge branch 'dev' into rp2040-socket-wake 2026-03-05 13:21:29 -10:00
J. Nick Koston 066c9b54dd Merge branch 'rp2040-upload-improvements' into integration 2026-03-05 13:18:54 -10:00
J. Nick Koston 788a6019bd imports 2026-03-05 13:18:36 -10:00
J. Nick Koston 90c3b94237 tweaks 2026-03-05 13:14:58 -10:00
J. Nick Koston 53da01a2bf Merge branch 'rp2040-upload-improvements' into integration 2026-03-05 13:11:22 -10:00
J. Nick Koston d1a669de72 Merge remote-tracking branch 'upstream/dev' into rp2040-upload-improvements 2026-03-05 13:11:02 -10:00
J. Nick Koston c12d4a4474 [rp2040] Extract picotool package const, fix platform check for udev hint
- Add PICOTOOL_PACKAGE constant for the PlatformIO package name
- Only show udev rules hint on Linux, not on macOS/Windows
2026-03-05 13:09:41 -10:00
J. Nick Koston ddbae0dd00 [rp2040] Always show BOOTSEL tip when no BOOTSEL device detected
Serial ports in the chooser may belong to other devices (e.g. FT232R),
not the RP2040. Show the BOOTSEL tip whenever no BOOTSEL device is
detected via picotool, regardless of whether serial ports are present.
2026-03-05 13:08:12 -10:00
J. Nick Koston 98e4a9f876 Merge branch 'dev' into rp2040-upload-improvements 2026-03-05 13:06:39 -10:00
J. Nick Koston aec76fafce [rp2040] Use picotool for BOOTSEL upload instead of mass storage copy
Replace UF2 file copy to mass storage volume with direct picotool upload.
This avoids macOS "disk not ejected properly" warnings caused by the RP2040
resetting immediately after receiving the firmware.

- Use picotool (already installed by PlatformIO) for BOOTSEL detection
  and firmware upload via USB
- Upload ELF directly with `picotool load -v -x` for real-time progress
- Remove platform-specific mass storage volume detection (macOS/Linux/Windows)
- Show helpful udev rules message on Linux permission errors
2026-03-05 12:59:07 -10:00
64098122e7 [audio_file] Add media source platform (#14436)
Co-authored-by: Copilot <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-05 12:30:13 -10:00
Jonathan SwobodaandClaude Opus 4.6 8a8f6824a2 [openthread][ethernet][wifi] Add IPv6 address array bounds assert (#14488)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 12:29:44 -10:00
tomaszduda23 b2c12d88fe [uart] init tx_pin, rx_pin, flow control, rx_buffer_size (#14524) 2026-03-05 12:24:11 -10:00
J. Nick Koston 4fd7d3a28f Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	esphome/components/wifi/wifi_component_pico_w.cpp
2026-03-05 11:48:05 -10:00
Jonathan SwobodaandClaude Opus 4.6 e8b1dce67b [st7735][st7789v][st7920] Fix display buffer overflows and dead code (#14511)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 16:28:41 -05:00
J. Nick Koston fbf63d8e3b [rp2040] Update arduino-pico to 5.5.1 and fix WiFi AP fallback (#14500) 2026-03-05 21:23:00 +00:00
Kevin AhrendtandJ. Nick Koston 06d6322fe3 [audio] Extract detect_audio_file_type helper (#14507)
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-05 21:19:45 +00:00
de14e7055e [cse7761][ads1115][tmp1075][matrix_keypad][seeed_mr60bha2] Fix assorted bugs (#14518)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-05 21:10:26 +00:00
3392e4d73b [usb_uart][nextion][feedback][whirlpool][packet_transport][he60r][hc8][runtime_stats] Fix millis() wrapping bugs (#14474)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-05 16:08:58 -05:00