Commit Graph
416 Commits
Author SHA1 Message Date
J. Nick Koston 53da01a2bf Merge branch 'rp2040-upload-improvements' into integration 2026-03-05 13:11:22 -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 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
J. Nick Koston cfc74ad638 Merge branch 'rp2040-upload-improvements' into integration 2026-03-04 14:25:09 -10:00
J. Nick Koston f886aa7f9a [rp2040] Fix firmware.bin.signed creation for nobuild upload
Move signed bin creation from post_build script to upload_using_platformio.
The post_build AddPostAction only runs during build, not during nobuild
upload, so the file was missing when PlatformIO tried to upload.
Now create firmware.bin.signed before calling PlatformIO upload.
2026-03-04 14:24:48 -10:00
J. Nick Koston d30175d84d Merge branch 'rp2040-upload-improvements' into integration 2026-03-04 14:18:29 -10:00
J. Nick Koston d856046830 [rp2040] Add test coverage for Linux and Windows mass storage detection
Add tests for get_rp2040_mass_storage_volumes() on Linux, Windows,
and unsupported platforms to improve test coverage.
2026-03-04 14:12:39 -10:00
J. Nick Koston 5f79e3e0c2 [rp2040] Fix test assertions for Windows path separators
Use str(Path(...)) in test assertions so paths match platform-specific
separators (forward slashes on Unix, backslashes on Windows).
2026-03-04 14:00:35 -10:00
J. Nick Koston 74dd61442a [rp2040] Improve upload experience with mass storage and BOOTSEL support
Add auto-detection of RP2040 BOOTSEL mass storage volumes (RPI-RP2) on
macOS, Linux, and Windows. Show detected volumes as upload targets with
a progress bar for UF2 file copy. Display helpful BOOTSEL instructions
when no RP2040 device is found.

- Add get_rp2040_mass_storage_volumes() to detect mounted RPI-RP2 volumes
- Add PortType.MASS_STORAGE and upload_using_uf2_copy() with progress bar
- Move ProgressBar to helpers.py for shared use
- Wait for USB-CDC serial port after upload for log output
- Auto-select single serial port for logs after mass storage upload
- Create firmware.bin.signed in post_build to fix nobuild upload target
- Show BOOTSEL tip when only OTA options are available
2026-03-04 13:50:52 -10:00
J. Nick Koston c52ff5dcbc Merge branch 'configure_entity' into integration
# Conflicts:
#	esphome/core/entity_base.h
2026-03-03 12:12:01 -10:00
J. Nick KostonandClaude Opus 4.6 42fa6ef818 [core] Merge set_name + set_entity_strings into configure_entity
Every entity generated two codegen calls:
  entity->set_name("Name", hash);
  entity->set_entity_strings(packed);

Merge these into a single configure_entity(name, hash, packed) call
to reduce generated code size. For a config with 50+ entities this
eliminates 50+ function calls from the generated setup() function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 11:47:14 -10:00
J. Nick Koston 214a27d49f Merge branch 'move_device_class_progmem' into integration 2026-03-03 11:23:20 -10:00
J. Nick Koston 2fe9de7dbc add max length validation for device class strings
Defense-in-depth: validate device class strings don't exceed the
48-byte PROGMEM buffer limit (47 chars + null), matching the same
pattern used for icon strings.
2026-03-03 11:23:06 -10:00
J. Nick Koston 6fd20056ad Merge branch 'move_icons_progmem' into integration 2026-03-03 08:23:52 -10:00
J. Nick Koston 1108511c63 move icons to progmem 2026-03-03 08:06:55 -10:00
J. Nick Koston 1f1b20f4fe [core] Pack entity string properties into PROGMEM-indexed uint8_t fields (#14171) 2026-03-03 07:03:24 -10:00
J. Nick Koston 74eda7fc01 Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-03-02 09:31:46 -10:00
J. Nick Koston 8ee800bb35 Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 07:53:19 -10:00
J. Nick Koston 96a564a6e9 [core] Replace Python unit tests with C++ integration test for micros_to_millis
The Python tests were testing a Python reimplementation, not the
actual C++ code. Replace with an integration test that exercises
the real micros_to_millis() on the host platform, covering boundary
values, carry paths, and mod-8 shift edge cases (25 checks).
2026-03-02 07:41:52 -10:00
J. Nick Koston 61eb8f3e14 Merge remote-tracking branch 'upstream/cache-lwip-sock-pointers' into integration
# Conflicts:
#	esphome/components/esp32/core.cpp
#	esphome/components/esp8266/core.cpp
#	esphome/components/host/core.cpp
#	esphome/components/libretiny/core.cpp
#	esphome/components/rp2040/core.cpp
#	esphome/components/zephyr/core.cpp
#	esphome/core/application.cpp
#	esphome/core/hal.h
2026-03-02 07:38:28 -10:00
J. Nick Koston 15a792ecce bot review 2026-03-02 07:34:47 -10:00
J. Nick Koston deea16698d Add tests for setup_entity direct-call and decorator modes 2026-03-02 07:13:49 -10:00
J. Nick KostonandClaude Opus 4.6 0f9c71714e Merge remote-tracking branch 'upstream/dev' into pack-entity-strings
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 07:05:08 -10:00
J. Nick Koston a1d91ac779 [core] Compile-time detection of loop() overrides (#14405) 2026-03-02 06:59:23 -10:00
J. Nick Koston 82da4935b6 [core] Auto-wrap static strings in PROGMEM on ESP8266 via TemplatableValue (#13885) 2026-03-02 06:57:08 -10:00
Copilotandjesserockz 77a7cbcffd Use cached files on network errors in external_files (#14055)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jesserockz <3060199+jesserockz@users.noreply.github.com>
2026-03-02 11:41:20 -05:00
J. Nick Koston 5041bc06aa Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 00:22:05 -10:00
J. Nick Koston cff32556a2 Add static_asserts and type hints to tests
Add compile-time static_asserts for micros_to_millis correctness.
Add parameter type hints and return annotations to test functions.
2026-03-02 00:21:44 -10:00
J. Nick Koston 7bed94aa38 Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 00:11:13 -10:00
J. Nick Koston df57c21368 [core] Template micros_to_millis for both 32/64-bit results
Make micros_to_millis a template on return type (default uint32_t).
millis_64() now calls micros_to_millis<uint64_t>() to eliminate
__udivdi3 there too — same Euclidean decomposition, just with a
32x32->64 multiply for hi*Q instead of truncating.

Add 64-bit variant tests (140 total, all passing).
2026-03-02 00:11:02 -10:00
J. Nick Koston a8f8c3753f Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 00:10:32 -10:00
J. Nick Koston 99aa5043a3 [core] Add unit tests for micros_to_millis, make constexpr
Add Python unit tests (70 cases) verifying the Euclidean decomposition
matches us // 1000 across edge cases: small values, hi/lo boundaries,
carry-path overflow, realistic uptimes, and shift-boundary mod-8
variations.

Make micros_to_millis constexpr to enable compile-time validation
via static_assert.
2026-03-02 00:05:06 -10:00
J. Nick Koston c876b95af5 Merge branch 'compile-time-has-overridden-loop' into integration
# Conflicts:
#	esphome/core/application.cpp
2026-03-01 12:08:14 -10:00
J. Nick Koston 78257db36a fix tests 2026-03-01 11:57:58 -10:00
J. Nick Koston 48b5cae6c4 [api] Use StringRef for user service string arguments (#13974) 2026-03-02 10:32:44 +13:00
J. Nick Koston 4ac226dbd5 Merge branch 'dev' into pack-entity-strings 2026-02-28 13:13:35 -10:00
J. Nick Koston 067d773aac [core] Make register_component protected, remove runtime checks (#14371) 2026-02-28 07:19:55 -10:00
J. Nick Koston 2d20986a37 Merge remote-tracking branch 'upstream/remove-register-component-public' into integration 2026-02-27 21:43:30 -10:00
J. Nick KostonandJ. Nick Koston 9967fc54d5 Drop template wrapper, call register_component_ directly
The template wrapper caused the compiler to make different
optimization decisions on setup(), negating the savings.
Calling register_component_ directly was -4 bytes.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:40:03 -10:00
J. Nick KostonandJ. Nick Koston d2af639e71 Keep original template name to preserve compiler optimizations
Using the original register_component name (just moved to protected)
produces identical compiled output to the baseline, avoiding the
symbol name length overhead from renaming.

Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:32:27 -10:00
J. Nick KostonandJ. Nick Koston 73fd1d68d5 Fix test_cpp_helpers to use register_component_
Co-Authored-By: J. Nick Koston <nick@koston.org>
2026-02-27 21:07:47 -10:00
J. Nick Koston c98b955881 Merge remote-tracking branch 'origin/pack-entity-strings' into integration 2026-02-21 22:13:39 -06:00
J. Nick Koston 5fd0ee1717 Merge branch 'dev' into pack-entity-strings 2026-02-21 22:12:49 -06:00
J. Nick Koston 655968af66 Merge remote-tracking branch 'origin/api-stringref-user-services' into integration 2026-02-21 22:10:03 -06:00
J. Nick Koston d21d897766 deferred 2026-02-21 21:12:31 -06:00
J. Nick Koston 38058d0308 deferred 2026-02-21 21:07:21 -06:00
J. Nick Koston fa343aa1ba tweaks 2026-02-21 20:49:49 -06:00
J. Nick Koston ec1dbd39ae tests 2026-02-21 20:37:28 -06:00
J. Nick Koston d5c9c56fdf [platformio] Add exponential backoff and session reset to download retries (#14191) 2026-02-21 19:41:43 -06:00
J. Nick Koston e74506b957 Merge branch 'scheduler_de_template' into integration 2026-02-21 17:34:37 -06:00